about how to make simple os article

48 views
Skip to first unread message

Yağız Kalender

unread,
Apr 17, 2020, 9:48:08 AM4/17/20
to MikeOS

        mov ax, 07C0h		; Set up 4K stack space after this bootloader
	add ax, 288		; (4096 + 512) / 16 bytes per paragraph
	mov ss, ax
	mov sp, 4096

i didnt get that "(4096 + 512) / 16 bytes per paragraph" what is mean why did you divide 16 why did you sum 4096 and 512 can you explain btw i love the mikeOS and my favourite app is memory manipulator in our language we dont have enough article about OSes and x86 assembly language

thanks for the article it is the only i can find for understanding basics and article language very simple thanks again i hope you will continue to develop mikeos

btw my english isnt good cany ou explain simple but satisfying

I8087

unread,
Apr 18, 2020, 11:11:41 PM4/18/20
to MikeOS
The reason is because segments work in paragraphs (4-bit offsets). For example, the start of the bootloader is at 0x7C00, but in segments it would be expressed in paragraphs as 0x7C0.

Dividing by 16 or shifting right 4 converts bytes to paragraphs.
Multiply by 16 or shifting left 4 converts paragraphs to bytes.

For a better example, see this Wikipedia page.
Reply all
Reply to author
Forward
0 new messages