CeDOS - Commit 7cc0b622

Moved kernel back to 0x100000 to allow for bigger ramdisk in the future (and to avoid collision with VGA memory)
Celina Kalus
Sat, 18 Mar 2023 22:36:42 +0100
3 files changed, 19 insertions(+), 2 deletions(-)
A src/boot/fat.h

@@ -0,0 +1,17 @@

+#ifndef FAT_H +#define FAT_H + +#include <stdint.h> + +typedef struct { + char jmp[3]; + char oemname[8]; + + uint16_t bytes_per_sect; + uint8_t sect_per_cluster; + uint16_t num_reserved_sectors; + uint8_t num_FAT; + uint16_t max_root_dir_entries; +} BOOT_SECT; + +#endif
M src/boot/paging.csrc/boot/paging.c

@@ -10,7 +10,7 @@ }

void ss_copy() { char *src = (char*)(0x14E00); - char *dest = (char*)(0x40000); + char *dest = (char*)(0x100000); int num = 0x80 * 0x200; for (uint32_t i = 0; i < num; i++) {

@@ -33,7 +33,7 @@ // map 4M of kernel to 0xC0000000

(*pdir)[PAGE_DIR_INDEX(0xC0000000)].entry = MAKE_PAGE_ENTRY(kernel, 0b000000000011); for (uint32_t i = 0; i < 1 << 10; i++) { - (*kernel)[i].entry = MAKE_PAGE_ENTRY(0x40000 + PAGE_SIZE * i, 0b000000000011); + (*kernel)[i].entry = MAKE_PAGE_ENTRY(0x100000 + PAGE_SIZE * i, 0b000000000011); } // identity map first 4M of memory