Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e20f343
do not whitespace-check files in external
qbojj Apr 7, 2025
baf451c
add initial bootloader infrastructure
qbojj Apr 1, 2025
777ca46
bootloader sample
qbojj Apr 7, 2025
be5c0a9
bootloader sample working
qbojj Apr 7, 2025
0bb724f
works frfr
qbojj Apr 7, 2025
e9503bb
change gnu-efi include dir to isystem
qbojj Apr 7, 2025
fdc08b5
make CI work
qbojj Apr 7, 2025
ef39e77
format
qbojj Apr 7, 2025
5981b3a
add missing files
qbojj Apr 7, 2025
b10512f
add missing files again
qbojj Apr 8, 2025
d6402ca
fix elf.h typedefs
qbojj Apr 9, 2025
6d02833
apt update in Ci
qbojj Apr 9, 2025
ed8782e
fix binaries
qbojj Apr 19, 2025
3427f42
fixup examples
qbojj Apr 19, 2025
7e91391
add gcc linux compiler to dependency list
GoscZnickiem May 18, 2025
5b0b72c
add simple kernel loading and FDT retrieval
GoscZnickiem May 18, 2025
ab6d534
add ext2 driver (not work)
GoscZnickiem May 19, 2025
229528d
visual and readability changes
GoscZnickiem May 21, 2025
d2b4ed4
add file system reading
GoscZnickiem May 21, 2025
b9001b1
add file reading functions
GoscZnickiem May 26, 2025
d36295b
add basic elf structures
GoscZnickiem May 27, 2025
03ce844
code reorganisation
GoscZnickiem May 27, 2025
d497766
finish partition handling
GoscZnickiem May 27, 2025
8ab95c8
Add helper for app exit
GoscZnickiem May 27, 2025
b103966
minor improvements
GoscZnickiem May 27, 2025
0fc16f1
add basic elf loading
GoscZnickiem May 28, 2025
1f70640
add logging - major cleanup
GoscZnickiem May 28, 2025
55929bd
add pre-config file reading
GoscZnickiem May 28, 2025
4002b2d
add pre-config loading
GoscZnickiem May 29, 2025
1a1ff0c
meta config and exit sequence fix
GoscZnickiem May 29, 2025
40d5609
small cleanup
GoscZnickiem May 30, 2025
c64ad50
I forgor
GoscZnickiem May 31, 2025
359d60c
add config file reading
GoscZnickiem Jun 3, 2025
750bc65
improve readability and debugability
GoscZnickiem Jun 4, 2025
984c9a3
add ELF file reading
GoscZnickiem Jun 4, 2025
159b1f8
add config dir processing
GoscZnickiem Jun 5, 2025
8adc002
small bugfix
GoscZnickiem Jun 5, 2025
4bba2a4
add kernel start
GoscZnickiem Jun 5, 2025
fca1054
add relocation handling
GoscZnickiem Jun 6, 2025
ef69391
Fix elf relocations
GoscZnickiem Jun 9, 2025
1933818
Pass fdt to kernel
GoscZnickiem Jun 9, 2025
c156e07
small cleanup
GoscZnickiem Jun 9, 2025
b44b98c
change NULL to nullptr
GoscZnickiem Jun 9, 2025
723bc3a
fix memset_explicit semantics
qbojj Apr 1, 2025
09c8885
apply patch from qbojj
GoscZnickiem Jun 10, 2025
4c83175
apply second patch from qbojj
GoscZnickiem Jun 10, 2025
2b85d63
move uefi stuff before exit boot services
GoscZnickiem Jun 10, 2025
4cc644d
fixup when bootloader gets boot hartid
qbojj Jun 10, 2025
934526c
Whoops
GoscZnickiem Jun 10, 2025
9ecd6f1
format
GoscZnickiem Jun 10, 2025
2e48377
Merge remote-tracking branch 'upstream/main' into bootloader
GoscZnickiem Aug 11, 2025
384d815
fix toolchain
GoscZnickiem Aug 11, 2025
fd6b4c6
Fix clang build test
GoscZnickiem Aug 12, 2025
b4d1a78
Remove tests
GoscZnickiem Aug 12, 2025
e0d1887
change loaded elf type to shared (pie exec)
GoscZnickiem Aug 14, 2025
754aa77
-std=gnu23
GoscZnickiem Aug 14, 2025
eca61a6
switch to standard ELF definitions
GoscZnickiem Aug 15, 2025
553422e
make the efidir always create when building
GoscZnickiem Aug 15, 2025
223809b
Replace magic numbers
GoscZnickiem Aug 15, 2025
262bb00
Revert "-std=gnu23"
GoscZnickiem Aug 16, 2025
d7b8fb9
revert toolchain changes
GoscZnickiem Aug 16, 2025
3c26671
Merge remote-tracking branch 'upstream/main' into bootloader
GoscZnickiem Aug 16, 2025
7aef82c
Merge remote-tracking branch 'upstream/main' into bootloader
GoscZnickiem Aug 16, 2025
5268a98
ELF parser overhaul
GoscZnickiem Aug 16, 2025
2110e60
add warning logging
GoscZnickiem Aug 16, 2025
eabac69
fix objcopy
GoscZnickiem Aug 16, 2025
1d8ad4a
add some comments
GoscZnickiem Aug 16, 2025
0514596
unsupport R_RISCV_JUMP_SLOT
GoscZnickiem Aug 17, 2025
7c493af
remove repetition from log.c
GoscZnickiem Aug 17, 2025
41bdd86
minor changes
GoscZnickiem Aug 19, 2025
57c2ba5
Merge remote-tracking branch 'origin/main' into bootloader
Msaters Apr 26, 2026
21e6c88
synced main and merged to bootloader to use fdt library, also impleme…
Msaters Apr 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMake/CommonConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ find_program(QEMU_FOUND_PATH "qemu-system-riscv64")

set(BIGOS_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat warnings as errors")
set(BIGOS_QEMU_PATH "${QEMU_FOUND_PATH}" CACHE PATH "path to qemu")
set(BIGOS_QEMU_OPTIONS "-machine virt -serial mon:stdio -nographic" CACHE STRING "options for qemu")
set(BIGOS_QEMU_OPTIONS "-machine virt -serial mon:stdio -nographic -m 2G" CACHE STRING "options for qemu")

separate_arguments(BIGOS_QEMU_OPTIONS_LIST UNIX_COMMAND "${BIGOS_QEMU_OPTIONS}")

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ project(BigOS LANGUAGES C ASM)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

add_subdirectory(external/efi)

include_directories(SYSTEM external/include)
include_directories(include)

Expand Down
21,204 changes: 21,204 additions & 0 deletions disk_creation/qemu.log

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions external/efi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project(gnu-efi)

add_library(gnu-efi INTERFACE)

set(EFI_DIR ${PROJECT_SOURCE_DIR})

set(LINKER_SCRIPT ${EFI_DIR}/lib/elf_riscv64_efi.lds)

target_link_options(gnu-efi INTERFACE
-T ${LINKER_SCRIPT} ${EFI_DIR}/lib/crt0-efi-riscv64.o
LINKER:-nostdlib,-znocombreloc,-Bsymbolic)

target_compile_options(gnu-efi INTERFACE
-fPIC -ffreestanding
-fno-stack-protector -fno-stack-check
-fshort-wchar -mabi=lp64d -march=rv64g
)

target_include_directories(gnu-efi SYSTEM INTERFACE ${EFI_DIR}/include/efi)
target_link_directories(gnu-efi INTERFACE ${EFI_DIR}/lib)
target_link_libraries(gnu-efi INTERFACE efi gnuefi)
90 changes: 90 additions & 0 deletions external/efi/include/efi/efi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*++

Copyright (c) 1998 Intel Corporation

Module Name:

efi.h

Abstract:

Public EFI header files



Revision History

--*/


// Add a predefined macro to detect usage of the library
#ifndef _GNU_EFI
#define _GNU_EFI
#endif

//
// Build flags on input
// EFI32
// EFI_DEBUG - Enable debugging code
// EFI_NT_EMULATOR - Building for running under NT
//


#ifndef _EFI_INCLUDE_
#define _EFI_INCLUDE_

#ifdef __cplusplus
extern "C" {
#endif

#define EFI_FIRMWARE_VENDOR L"INTEL"
#define EFI_FIRMWARE_MAJOR_REVISION 12
#define EFI_FIRMWARE_MINOR_REVISION 33
#define EFI_FIRMWARE_REVISION ((EFI_FIRMWARE_MAJOR_REVISION <<16) | (EFI_FIRMWARE_MINOR_REVISION))

#if defined(_M_X64) || defined(__x86_64__) || defined(__amd64__)
#include "x86_64/efibind.h"
#elif defined(_M_IX86) || defined(__i386__)
#include "ia32/efibind.h"
#elif defined(_M_IA64) || defined(__ia64__)
#include "ia64/efibind.h"
#elif defined (_M_ARM64) || defined(__aarch64__)
#include "aarch64/efibind.h"
#elif defined (_M_ARM) || defined(__arm__)
#include "arm/efibind.h"
#elif defined (_M_MIPS64) || defined(__mips64__) || defined(__mips64)
#include "mips64el/efibind.h"
#elif defined (__riscv) && __riscv_xlen == 64
#include "riscv64/efibind.h"
#elif defined (__loongarch64)
#include "loongarch64/efibind.h"
#else
#error Usupported architecture
#endif

#include "eficompiler.h"
#include "efidef.h"
#include "efidevp.h"
#include "efipciio.h"
#include "efiprot.h"
#include "eficon.h"
#include "eficonex.h"
#include "efiser.h"
#include "efi_nii.h"
#include "efipxebc.h"
#include "efinet.h"
#include "efiapi.h"
#include "efifs.h"
#include "efierr.h"
#include "efiui.h"
#include "efiip.h"
#include "efiudp.h"
#include "efitcp.h"
#include "efipoint.h"
#include "efishell.h"

#ifdef __cplusplus
}
#endif

#endif
78 changes: 78 additions & 0 deletions external/efi/include/efi/efi_nii.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#ifndef _EFI_NII_H
#define _EFI_NII_H

/*++
Copyright (c) 2000 Intel Corporation

Module name:
efi_nii.h

Abstract:

Revision history:
2000-Feb-18 M(f)J GUID updated.
Structure order changed for machine word alignment.
Added StringId[4] to structure.

2000-Feb-14 M(f)J Genesis.
--*/

#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \
{ 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29} }

#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION 0x00010000
#define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION

typedef enum {
EfiNetworkInterfaceUndi = 1
} EFI_NETWORK_INTERFACE_TYPE;

typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {

UINT64 Revision;
// Revision of the network interface identifier protocol interface.

UINT64 ID;
// Address of the first byte of the identifying structure for this
// network interface. This is set to zero if there is no structure.
//
// For PXE/UNDI this is the first byte of the !PXE structure.

UINT64 ImageAddr;
// Address of the UNrelocated driver/ROM image. This is set
// to zero if there is no driver/ROM image.
//
// For 16-bit UNDI, this is the first byte of the option ROM in
// upper memory.
//
// For 32/64-bit S/W UNDI, this is the first byte of the EFI ROM
// image.
//
// For H/W UNDI, this is set to zero.

UINT32 ImageSize;
// Size of the UNrelocated driver/ROM image of this network interface.
// This is set to zero if there is no driver/ROM image.

CHAR8 StringId[4];
// 4 char ASCII string to go in class identifier (option 60) in DHCP
// and Boot Server discover packets.
// For EfiNetworkInterfaceUndi this field is "UNDI".
// For EfiNetworkInterfaceSnp this field is "SNPN".

UINT8 Type;
UINT8 MajorVer;
UINT8 MinorVer;
// Information to be placed into the PXE DHCP and Discover packets.
// This is the network interface type and version number that will
// be placed into DHCP option 94 (client network interface identifier).
BOOLEAN Ipv6Supported;
UINT8 IfNum; // interface number to be used with pxeid structure
} EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE;

// Note: Because it conflicted with the EDK2 struct name, the
// 'EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL' GUID definition,
// from older versions of gnu-efi, is now obsoleted.
// Use 'EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID' instead.

#endif // _EFI_NII_H
Loading