Commit Graph

71 Commits

Author SHA1 Message Date
37eb87239c moved varibles passed from vbr to .data section
this is to work around having to save them without .bss ready
2024-12-19 15:18:28 -05:00
63a1a1beea might have fixed some of the boot_drive issues with ext_read 2024-12-19 13:13:46 -05:00
c9f4b18d2b some debuging text for fat32 stuff 2024-10-15 20:37:49 -04:00
fb54c65caf remove jmp short init at the start of stage2
also correct total size output as combined .data + .text
2024-10-15 18:33:57 -04:00
7f6436297e align to 16 byte bounds and add git info to build 2024-10-15 18:28:06 -04:00
5159ef8a7c correct size of operand in PrintDWORD
added some magic debug points for stuff that isn't working as well.
2024-10-15 13:32:36 -04:00
50b08f6b72 turn off magic debug in mbr/vbr stages 2024-10-15 13:31:32 -04:00
a97e3bea9b removed bpb_offset_bx dep
reworked init: process
512 byte stack...should be more than enough for the vbr
2024-10-15 12:57:54 -04:00
aa8c7b67ab moved stack to end of bss & reduced size for now.
removed redzone label
reordered sp/bp setup and bss zeroing in init:
fixed kmemcpy call stack usage
2024-10-15 12:56:12 -04:00
b4621a7fb8 reduced stack size in mbr stage
removed some unused data in bss
reordered how/when in init we set sp/bp and zero bss
we now push the top of the stack pointer/bp at the top of the stack, which makes the stack frame more 'normal'
also use movsb instead of movsw
2024-10-15 12:53:22 -04:00
c49de28a15 use bochs magic breakpoints in the error printer
makes it easier to get a good state to do some investigating before reseting.
2024-10-13 20:53:13 -04:00
86564b2356 added partition_table and fat32_bpb params to stage2
also the partition table and fat32_bpb and passed/copied from the mbr/vbr now
2024-10-13 17:54:06 -04:00
5ba7801926 bss for vbr stage 2024-10-13 17:52:28 -04:00
35e9aec059 fixed bss init in mbr 2024-10-13 17:52:09 -04:00
736aad85e5 pass location of partition_table structure to vbr 2024-10-13 16:41:39 -04:00
c1a9d449df bss convertion for mbr stage 2024-10-13 16:36:11 -04:00
ce6240249a turns out huge unreal mode isn't supported in bochs
huge unreal mode is 4GiB code in 16bit mode + 4GiB data
we will just use the regular big flat model instead (64KiB code/4GiB data)
2024-10-13 14:50:49 -04:00
963dec5281 unreal gdt tweaks & fixes 2024-10-13 13:22:01 -04:00
eb97aac673 relocate code sections to end up with stage2 starting at 0x500 2024-10-12 22:14:47 -04:00
050f90517a follow standard proceedure and reallocate the mbr to 0x600 2024-10-12 21:21:43 -04:00
555cf1271b partially roll back changing the segment to 0x07E0 2024-10-12 20:25:04 -04:00
8fea1f0a06 big step...and also its completely broken right now
we are going to use 0x07E0 as our base segment so we have a bit
more memory to work with until we are fully in 32bit protected mode.

this commit is broken but is just one step towards a working release.
2024-10-12 15:41:39 -04:00
83aa7d1147 use early_mem.inc 2024-10-12 15:38:47 -04:00
d1217182d4 minor cleanup related to memory refactor 2024-10-12 12:57:56 -04:00
5a74cd86ad moved stuff that is only referenced in Stage2 to stage2 bss 2024-10-12 12:55:29 -04:00
69c068f6be stage2 is now a multisection binary file
also preparing to move memory globals to bss section.
2024-10-12 11:29:20 -04:00
63421661a7 output symbol maps to ease debuging 2024-10-12 11:28:25 -04:00
96de8cd9c7 move far jump setup in EnterUnrealMode to right after we save CS 2024-10-11 21:51:07 -04:00
d73a4eea6c move macro definition super early
fix a few mistakes in macro defs
2024-10-11 19:31:31 -04:00
5703bad704 added macros to define cstr and str
aligned all the entry points for proceedures to 4 bytes
added a PrintString wraper macro
2024-10-11 19:05:15 -04:00
a3f0684c85 added bochs debug wrappers 2024-10-11 19:03:27 -04:00
df3b8dfc0c fix passing stage2 wrong data for boot drive 2024-10-11 13:09:17 -04:00
ccb82f29fc rename file to BOOT.BIN
K.I.S.S.
2024-10-11 12:16:01 -04:00
13ff42a7d1 unreal gdt now has 2 selectors 1 code, 1 data
ss, and e/f/g segments are loaded to the same flat 4gb segment
moved gdt notes to documentation
2024-10-08 20:22:21 -04:00
6643e3c990 ensure 2 byte jmp rel8 thunk to init
surpress reloc abs warnings
corrected include paths/filenames
2024-10-08 08:55:17 -04:00
ca195e6048 force the first jump to init in all stages to be the rel8 version 2024-10-07 20:39:39 -04:00
db45a5cf8b jmp imm32 vs jmp rel8 (5 bytes vs 2 bytes) 2024-10-06 21:46:32 -04:00
aac964c378 cutting out everything from miniboot
this file has always just been a place holder to get some code to load from the disk
I wanted to cut out all the extra stuff in it just to simplify things down.
2024-10-06 18:52:20 -04:00
3c40190f23 surpress some of the relocation warnings for mbr, vbr & stage2 2024-10-06 18:50:32 -04:00
4c4c3b0e27 fixed read_disk_raw in ReadFATCluster
boot_drive and partition_offset are global pointers now
removed an extra error from mbr disk read
and some general formating and cleanup 😅
2024-10-05 20:14:00 -04:00
f5f5a330cd tons more work on modularizing the code 2024-10-05 18:55:00 -04:00
446dd451be more modularization and updating date in MIT licence header 2024-10-05 13:35:39 -04:00
867232890e Move fat32 and BIOS functions to their own files 2024-10-05 12:04:40 -04:00
a0df1cb100 remove the dword stack macros and just use the 32bit override 2024-10-05 10:13:18 -04:00
6b2b1d2fc9 change test kernel stage name
also pointed up a bug in memory.inc
2024-10-04 22:17:35 -04:00
db1d0295c5 some bpb/ebpb tweaks 2024-10-04 11:48:25 -04:00
ecd858f030 vbr cdecl overhaul
refactored read_disk_raw to read_stage2_raw
switched to new kmem functions
2024-10-04 09:56:41 -04:00
e45f1cb27d move cdecl macros to nearly the top so early functions can use them 2024-10-04 09:55:45 -04:00
a6a774484f cdecl16 overhaul for mbr code
switch to cdecl kmem* functions
refactored read_disk_raw to read_vbr_raw
fixed a small issue where the mbr wasn't checking its signature
2024-10-04 09:55:19 -04:00
60ad0d71e0 add bpb and ebpb reserve area back to vbr.nasm 2024-10-03 21:00:02 -04:00