diff options
-rw-r--r-- | .gitmodules | 4 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | boot/entry.asm | 9 | ||||
-rwxr-xr-x | run | 18 |
4 files changed, 7 insertions, 25 deletions
diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fbf2860..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "ext2util"] - path = ext2util - url = https://github.com/lazear/ext2util.git - ignore = dirty @@ -87,7 +87,6 @@ Knowledge: Resources: - [Spleen font](https://github.com/fcambus/spleen) - [MIT License](https://github.com/fcambus/spleen/blob/5759e9abb130b89ba192edc5324b12ef07b7dad3/LICENSE) -- [ext2util](https://github.com/lazear/ext2util) - [MIT License](https://github.com/lazear/ext2util/blob/9bbcc81be46416491f8d46f25f7f775cfb7f2261/LICENSE) Libraries: - [upng (heavily modified lodepng)](https://github.com/elanthis/upng) - [ZLIB License](https://github.com/lvandeve/lodepng/blob/7fdcc96a5e5864eee72911c3ca79b1d9f0d12292/LICENSE) diff --git a/boot/entry.asm b/boot/entry.asm index 0379133..cf632b1 100644 --- a/boot/entry.asm +++ b/boot/entry.asm @@ -268,9 +268,9 @@ lba: times SECTOR_SIZE - ($ - $$) db 0 dw SECTOR_END -; This is the second stage. It tries to load the kernel (inode 5) into memory. +; This is the second stage. It tries to load the kernel into memory. ; To do this, it first checks the integrity of the ext2 fs. Then it has to find -; the address of the fifth inode and load its contents into memory. +; the address of the root inode (2), find the filename in it and load its contents into memory. ; After this is finished, the stage can jump into the protected mode, enable the ; A20 line and finally jump to the kernel! ez stage_two: @@ -283,8 +283,9 @@ stage_two: mov ax, [superblock + EXT2_SB_SIZE + EXT2_TABLE_OFFSET] ; Inode table shl ax, 1 ; Multiply ax by 2 mov [lba], ax ; Sector - mov ax, 2 - mov [count], ax ; Read 1024 bytes + ; TODO: This might only work with smaller inodes + ;mov ax, 4 + ;mov [count], ax ; Read 4kb mov bx, EXT2_INODE_TABLE_LOC ; Copy data to 0x1000 mov [dest], bx call disk_read @@ -122,25 +122,10 @@ make_build() { (echo "e 0"; echo 83; echo n; echo 0; echo "*"; echo "quit") | $SUDO fdisk -e $VND >/dev/null $SUDO mkfs.ext2 -F /dev/${VND}i >/dev/null - if [ "$(cd ext2util/ && git diff --name-only | wc -l | xargs)" -ne "5" ]; then - cd ext2util - git stash - find ./ -type f -exec sed -i -e 's/sync/fs_sync/g' {} \; - sed -i 's/gcc/egcc/g' Makefile - $MAKE - cd .. - fi - $SUDO dd if=build/boot.bin of=/dev/${VND}i conv=notrunc status=none - cp build/load.bin . # For nicer disk img - $SUDO ./ext2util/ext2util -x /dev/${VND}i -wf load.bin -i 5 >/dev/null - rm load.bin else $SUDO mke2fs -q build/disk.img dd if=build/boot.bin of=build/disk.img conv=notrunc status=none - cp build/load.bin . # For nicer disk img - ./ext2util/ext2util -x build/disk.img -wf load.bin -i 5 >/dev/null - rm load.bin fi # Set test app as init @@ -156,6 +141,7 @@ make_build() { fi $SUDO cp -r disk/* mnt/ $SUDO cp -r build/apps/ mnt/bin/ + $SUDO cp build/load.bin mnt/ $SUDO cp build/kernel.bin mnt/ $SUDO umount mnt/ rm -rf mnt/ @@ -203,7 +189,7 @@ ${data}" } make_sync() { - $TAGS -R --exclude=.git --exclude=build --exclude=disk --exclude=cross --exclude=ext2util --exclude=boot . + $TAGS -R --exclude=.git --exclude=build --exclude=disk --exclude=cross --exclude=boot . rm -f compile_commands.json output=$($MAKE --always-make --dry-run) |