Commit Graph

71 Commits

Author SHA1 Message Date
4e5112b45b move unreal mode hackery back to stage2.nasm 2025-09-05 20:32:19 -04:00
b0bd4b27b0 🎉 simple allocator init in the code 2025-09-05 16:48:24 -04:00
cd316afdd1 basic arena allocator implementation 2025-09-05 16:42:25 -04:00
9a478aa4d4 added another __REFLAT variant 2025-09-05 16:28:01 -04:00
31d05c35e5 move __TINY_DS_ES to unreal_mode function
also some cleanup
2025-09-05 16:18:34 -04:00
b5ae11f850 set ds/es to a tiny memory model after entering Unreal mode
ss/fs/gs will all be huge/flat model after
2025-09-05 15:43:22 -04:00
b9b3e92632 actually set cs to 16-bit segment for a bit in-case we want to run some pm code 2025-09-05 15:26:24 -04:00
01ec6da0cc make unreal mode unreal again 2025-09-05 11:45:46 -04:00
c3871d2b7d move string functions to video.nasm
caught a bug where SetTextMode was setting mono text not 16-color mode
2025-09-05 10:33:03 -04:00
d824493ba2 small clarification on what "unreal" mode really is 2025-09-05 09:12:55 -04:00
b106eae066 fix alignment macros 2025-09-04 20:04:03 -04:00
28b23b9ce2 paragraph align the values in bss 2025-09-04 15:32:42 -04:00
402bf9974d moved map file output to build
moved output of builds to build/output
updated gitea action
2025-08-24 10:47:18 -04:00
8d5996566e Update licensing and switch back to GPLv3 😅 2025-08-22 11:41:33 -04:00
b2c5a6bf46 macro defines this as BootTarget_cstr_cstr...fix this 2025-01-12 22:24:42 -05:00
531f4fa25f Merge branch 'fat32_sys_rewrite' of github.com:Nivirx/stevia into fat32_sys_rewrite 2025-01-12 20:00:51 -05:00
d6e8a2a923 minor cleanup and add dev enviroment files to gitignore 2024-12-20 02:07:46 +00:00
9918f2367e Merge upstream changes from branch 'trunk' into fat32_sys_rewrite 2024-12-19 20:09:48 -05:00
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
3bdef99939 typo 2024-10-19 11:17:09 -04:00
d98786072c use movzx instead of goofy mov word and and mask the upper bits 2024-10-18 07:58:40 -04:00
520f877b05 make space in bss directly for boot_drive and partition offsets 2024-10-17 20:33:44 -04:00
4708c78d54 correction 2024-10-17 14:33:32 -04:00
496a389ba4 remove newline and fix stack at end 2024-10-17 14:16:14 -04:00
2b3ab1dc3a changed informational strings 2024-10-17 14:15:49 -04: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
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
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
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
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
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
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
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
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