I am working to get FreeDOS running on my 286 system. As part of this, I am
trying to improve my BIOS code. As I look at the stack setup when the system
initializes, I am using the following.
; org 0x0000
xor ax, ax
mov ds, ax
mov bp, 0x8000
mov ss, ax
mov sp, bp
mov ax, 0xf000 ; ROM data
mov es, ax
Based on https://en.wikibooks.org/wiki/X86_Assembly/Bootloaders and
https://github.com/kaneton/appendix-bios (and as I understand it), 0x8000 is
used for bp and sp upon system initialization. I expect FreeDOS changes the
location of the stack multiple times during boot as the boot sector is
loaded/moved and as the kernel is loaded.
Am I OK with the stack setup I am using prior to loading FreeDOS, or should
I consider a different/better approach?
Thanks!
Rich
; *286 system physical memory map*
; -------------------------------
; - ROM (256 KB) -
; - 0xC0000-0xFFFFF -
; -------------------------------
; - I/O & Expansion (64 KB) -
; - 0xB0000-0xBFFFF -
; -------------------------------
; - VIDEO (64 KB) -
; - 0xA0000-0xAFFFF -
; -------------------------------
; - RAM (640 KB) -
; - 0x00000-0x9FFFF -
; -------------------------------
;
; **************************************
; from boot32lb.asm (fat32 lba):
; ...
; |-------| 1FE0:7E00
; |BOOTSEC|
; |RELOC.|
; |-------| 1FE0:7C00
; ...
; |-------| 2000:0200
; | FAT | (only 1 sector buffered)
; |-------| 2000:0000
; ...
; |-------| 0000:7E00
; |BOOTSEC| overwritten by the kernel, so the
; |ORIGIN | bootsector relocates itself up...
; |-------| 0000:7C00
; ...
; |-------|
; |KERNEL| maximum size 134k (overwrites bootsec
origin)
; |LOADED| (holds 1 sector directory buffer before
kernel load)
; |-------| 0060:0000
; ...
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel