summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-28 09:26:22 +0200
committerGitHub <noreply@github.com>2025-08-28 09:26:22 +0200
commitf24e3cd5212e533f9dc0125c62f4d36fb9882cee (patch)
treee051f262440357b4f4a89603b68b473ee68aad87
parent7802a79f34c6f96f1c1ead72098c449b1a8826d8 (diff)
parent93baf62a3d02ad107a92c429fc528c26a9f7b664 (diff)
Merge pull request #7 from nekernel-org/dev
v0.0.1e1 — New York
-rw-r--r--lib/bootnet.h9
-rw-r--r--src/arm64/makefile2
-rw-r--r--src/neboot-start.c12
3 files changed, 13 insertions, 10 deletions
diff --git a/lib/bootnet.h b/lib/bootnet.h
index 8363c39..b0c3fd9 100644
--- a/lib/bootnet.h
+++ b/lib/bootnet.h
@@ -13,11 +13,13 @@
#define BOOTNET_NAME_LEN (256)
+struct _bootnet_inet_header;
+
/// @brief Netboot Internet Header
/// Consists of 4 magic characters, and a set of fields describing the current patch that's being
/// sent (if m_preflight = 0)
/// @note Can be used to patch ROMs too (if m_implies_rom = 1)
-typedef struct bootnet_inet_header {
+typedef struct _bootnet_inet_header {
ascii_char_t m_nb1; /// magic char 1 'N'
ascii_char_t m_nb2; /// magic char 2 'E'
ascii_char_t m_nb3; /// magic char 3 'T'
@@ -29,4 +31,7 @@ typedef struct bootnet_inet_header {
uint8_t m_implies_rom; /// does it imply reprogramming?
uint8_t m_preflight; /// Do we just check if this endpoint exists/is valid?
uint8_t m_blob[];
-} bootnet_inet_header;
+} __attribute__((packed)) bootnet_inet_header_t;
+
+/// @brief Alias for the BootNet pointer.
+typedef bootnet_inet_header_t* bootnet_inet_header_ptr_t;
diff --git a/src/arm64/makefile b/src/arm64/makefile
index a85553b..c4e7083 100644
--- a/src/arm64/makefile
+++ b/src/arm64/makefile
@@ -28,7 +28,7 @@ FLAGS_LD= --script=script.lds -o core-boot.elf -nostdlib
OBJCOPY=aarch64-elf-objcopy
EMU=qemu-system-aarch64
-EMU_FLAGS=-M virt -cpu cortex-a57 -bios $(FIRMWARE) -m 256M -d int -smp 2
+EMU_FLAGS=-M virt -cpu cortex-a57 -bios $(FIRMWARE) -device loader,file=$(STAGE2),addr=0x60000000 -m 4G -d int -d guest_errors
WAIT=sleep 1
diff --git a/src/neboot-start.c b/src/neboot-start.c
index 8384791..b72793e 100644
--- a/src/neboot-start.c
+++ b/src/neboot-start.c
@@ -113,7 +113,7 @@ void cb_start_exec(void) {
} else {
cb_put_string("CB> Trying EPM partition...\r\n");
- part_block_t* blk = cb_parse_partition_block_at((voidptr_t) NB_BOOT_ADDR, EPM_PART_BLK_SZ, 0);
+ part_block_t* blk = cb_parse_partition_block_at((voidptr_t) NB_FLASH_BASE_ADDR, EPM_PART_BLK_SZ, 0);
if (blk) {
cb_pci_append_tree("@stage2-epm", (cb_pci_num_t) blk, sizeof(part_block_t) * blk->num_blocks);
@@ -144,12 +144,10 @@ void cb_start_exec(void) {
}
/// end of TODO
-
- if (hart > 1) {
- while (yes) {
- if (__cb_hart_counter == 0) {
- cb_restart_machine();
- }
+
+ while (yes) {
+ if (__cb_hart_counter == 0) {
+ cb_restart_machine();
}
}
}