Page 1 of 1

Need tips to start on my OS

Posted: Tue Jan 10, 2006 12:05 am
by Arul Jose
Dear OS techie,

I am working as a faculty for a software company in India.

I want to develop a small os (my dream command is linux 'ls') to teach to my students.

Let me tell you what I know.

I know some basics of assembly.

I know that BIOS will start reading from sector 0 in the disk (which we specify in the bios settings). So we need to have our bootloader in sector 0.

I went on reading a few articles (where I found these things) and did a few work. I made a program in sector 0 to print my name on the screen immediately after the POST is over. I could not find clear information on how to proceed further.

For example see the code given below in the following article

http://osdever.net/bkerndev/index.php?the_id=90

start:
mov esp, _sys_stack ; This points the stack to our new stack area
jmp stublet
Here there is no clear information where _sys_stack points too or what is _sys_stack. May be I lack knowledge to understand what is said here exactly.

Where do you think I should start?

U know any links/books?

My sincere advance thanks to any help in this regards

ARUL JOSE

Re:Need tips to start on my OS

Posted: Tue Jan 10, 2006 1:07 am
by RetainSoftware
maybe reading the OS-FAQ http://www.osdev.org/osfaq2/ completely helps you to get even more knowledgeable about the subject.

as for your example _sys_stack can point anywhere except addresses used by hardware & BIOS but is again dependant on real-mode(1MB limit) or protected mode(4GB limit).

your best bet will be the FAQ and find some opensource OSes like newos.

Rene Kootstra

Re:Need tips to start on my OS

Posted: Tue Jan 10, 2006 3:59 am
by Pype.Clicker
I suggest you google for "geekOS" if the FAQ doesn't help you enough. afaik, GeekOS is a bare OS (including the bootloader, etc.) that has been written for teaching purpose, including programming exercises for students, etc.

As for the "sys stack" stuff,
As far as code goes, all this file does is load up a new 8KByte stack, and then jump into an infinite loop.
and

Code: Select all

; Here is the definition of our BSS section. Right now, we'll use
; it just to store the stack. Remember that a stack actually grows
; downwards, so we declare the size of the data before declaring
; the identifier '_sys_stack'
SECTION .bss
    resb 8192               ; This reserves 8KBytes of memory here
_sys_stack:
If that still leaves you clueless, i suggest you go through a copy of "The Art of Assembly Programming" -- or any other book that explains the details of computer's internal structures such as William Stallings writings.