set ds/es to a tiny memory model after entering Unreal mode

ss/fs/gs will all be huge/flat model after
This commit is contained in:
2025-09-05 15:43:22 -04:00
parent b9b3e92632
commit b5ae11f850
2 changed files with 8 additions and 2 deletions

View File

@@ -69,8 +69,8 @@
%endmacro %endmacro
%endif %endif
%ifnmacro __DEFLAT_DS_ES %ifnmacro __TINY_DS_ES
%macro __DEFLAT_DS_ES 0 %macro __TINY_DS_ES 0
mov ax, __STAGE2_SEGMENT mov ax, __STAGE2_SEGMENT
mov ds, ax mov ds, ax
mov es, ax mov es, ax

View File

@@ -162,6 +162,12 @@ main:
; enter unreal mode (16 bit code, 32 bit flat memory model) ; enter unreal mode (16 bit code, 32 bit flat memory model)
call EnterUnrealMode call EnterUnrealMode
; set ds, es to the STAGE2_SEGMENT, for our model (generally) ds == es == cs
; fs, gs & ss are all still huge data model, and the macro "__REFLAT_DS_ES" exists
; to easily access data outside of 64KiB boundries using ds/es addressing
__TINY_DS_ES
print_string UnrealMode_OK_info print_string UnrealMode_OK_info
; FAT Driver setup ; FAT Driver setup