Can some one help understand the how to set the stack for the OS.
As far as I understood, the SS is to be set by the "programmer" to 1024 (1k) and move the SP to the top of it, is that correct?
and I found the below on MikeOS tutorial, not sure how adding 544 to 07c0 will add 4k buffer
bootloader_start:
mov ax, 07C0h ; Set up 4K of stack space above buffer
add ax, 544 ; 8k buffer = 512 paragraphs + 32 paragraphs
This is the code I use to set the stack segment.
; NASM syntax
xor ax, ax ; or set ax to whatever segment you wish
mov ss, ax ; IIRC, you can't just go mov ss, 0
mov sp, 0xF000 ; or set sp to whatever you wish
I don't think I had to put the stack there. You can put it wherever you want, as long as you don't overwrite system data.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.