Page 1 of 1

registers in bootloader

Posted: Sat Apr 19, 2003 7:47 am
by nitroglycerin
hey!

I've found this XOS and it starts by doing this:

mov ax,cs
mov ds,ax
mov es,ax
mov fs,ax

mov ax,0x1D0
mov ss,ax
mov sp,0x200

mov ax,0xb800
mov gs,ax

now, few questions: CS is CodeSegment, right? so why is DataSegment put on the same place? and what are ES & FS?

also, why is stack put on 0x1D0 with 512 bytes- is there a rule about this memory layouts or what?

the same with GraphicSegment: is 0xB800 obligated or just free will?

thanks

Re:registers in bootloader

Posted: Sat Apr 19, 2003 8:50 am
by distantvoices
for 0xb8000 - this is the start of the text video memory, where you can put ascii codes to have them output on the screen. unless you don#t have a valid gs prepared for this, you should leave this value in gs untouched even in protected mode.

Re:registers in bootloader

Posted: Sat Apr 19, 2003 11:48 am
by Ozguxxx
Hey, Im just curious, where did you find this code? I was planning to use "xos", ill be happy if you can give link... Thanx...

Re:registers in bootloader

Posted: Sat Apr 19, 2003 4:27 pm
by nitroglycerin
Shoot me if I'm wrong ;) but I think that it was on osdev.neopages.net - look under "docs" and "tutorials"
may I say that this site is great for os dev? I downloaded 99% of material available there

Re:registers in bootloader

Posted: Sun Apr 20, 2003 4:04 am
by distantvoices
on that page there are many nifty things to find, i admit :-)) 've found myself a load of good stuff there.