Friends I am working on building a fully functional Operating System from Scratch. Anyone who is interested can contact me or post in the forum
I am presently using Nasm as Assembler for bootloader
and C/C++ for Kernel Coding
It will be protected mode OS with a New GUI in high Resolution working on SVGA
Development has started and the source code will be published soon
of the modules i write or complete
Viewers can provide more optimized routines or ask any questions for their projects
hmm, i can help you, some beta test, or start coding i know c/c++ and asm of course. So let me know if you whant me to help developing it.
Foremost thing required for booting a computer is a BootLoader
So we re gonna begin working on a bootLoader
In fact Bootloader is the first thing which starts on your pc when you power it.
Bios loads Bootloader from a specific address 0x0:07C0 from the device set up in Bios
Moreover the system works in 16 bit mode
rest later
In next tutorial , we'll discuss Botloader generation.
Till that time , you can download Bochs or any emulator for your operating system like Microsft Virtual PC or Bochs as said earlier
It will help you a lot in OS Dev.
It will save you from frequent shutdowns.
Good luck with it, I hope it works out for you guys.
I would like to recommend a very useful tool to you guys for beta testing and all. It is called VMware Workstation, details can be found at http://www.vmware.com/products/desktop/ws_features.html . I've used it a few times on my own, it's really good.
That should be a little bit easier than plugging in an entirely different computer, wiping the hard drive, yadda, yadda, yadda.
Basically, you run the program, and it acts as a regular computer, but it uses a virtual hard drive to store the OS on. It uses your own disk space, but it doesn't add a partition or anything.
- Mike.
I would like to test it.
How long are you working on it ??? I think that its hard work to do.
Good luck
Can you advice me, what book is good for beginners in C/C++ ??
Very impressive idea guys. Good Luck and please keep us all informed on your progress. And you probably don't know the answer to this yet, but what main features are you shooting for? and what current OS will it be similar too. Good Luck! 
Exciting topic! I just listen to all of you!
I really am up for new operating systems. Throw me a pm when you get around to the beta and Ill see what I can do!
I also want to know, is it going to distrubuted under the GPL or is it going to be commercial?
Awesome job! Shirish it is really a nice project. I hope you'd be successful with it. 
This looks like a very exciting project. Is there anything in this that will make it different to/better than current OSs? Here are a few suggestions:
- Encourage users not to use Admin-level accounts day-to-day
- Allow access to all levels of customisation
- DBFS and such, as detailled here
If you want help, I know some C/C++, can beta-test, and have a great deal of spare time for the next few weeks.
I been planning to work on an OS by myself as i wish to learn the concept of the multitasking OS. I have read up on some ASM and knows Java, i will need some time to learn C++ tho.
I am intersted in well in helping out. If you have a cvs repository or place with files I can see if I can contribute anything to the project.
I will be uploading the code in the forum only
But the other files will be on my new site on frihost.net
as soon as i launch it
Ya this new os will be totally customizable
It would have a futuristic interface
it would treat all the files and data as objects
People would be able to link to other easily
and work could be done easily using speech or command line or desktop interface using Natural languages (English preffered)
Any more suggestions ?
I will post tye of interface i'm looking for soon
Basically it will be able to handle hardware very well
since i'm intrested in making it to be able to control miniature robots or bigger ones when it develops more.
People would be able to use it as a standalone OS for running their customised applications
By this ppl would have Customised Application OS ready to run
Presently any intrested coders can put up their version of bootloaders on the forum
you can also make suggestions for it about the features wanted
or any display interface like that in SUSE Linux
i like it very much
even mandrake is cool
What is going to be different between your OS and the dozens that are available out there (and I'm not just talking about Linux, Unix, and BSD variants, the dozens of other OS).
One of two possibilities exist. Either you are an experienced systems programmer or you aren't.
If you aren't an experienced programmer, you'll learn a lot, but it will take you forever just to make the OS work, let alone make it better. Still it's a worthwhile thing to take a stab at... if you get stuck, study some of the other open source OS's and see how they did it.
If you are an experienced programmer, you're wasting your talent! Join an existing OS project and add the features you'd like to see. If they don't accept your changes, fork your project, but at least you won't be starting from nothing! If you're interested in writing kernel stuff at least you'll have the higher level functionality of the existing OS you can put on top of it and immediately have something that is useful. If you're interested in writing something higher level, like a window manager or a file system, you can use it with the existing kernel.
I know I sound like one of those cranky people who are saying "It's impossible, it will never work!"
That's not my intention. Operating systems have been written before, so it's possible... I'm just saying that when you see the sheer amount of work this takes, you'll give up, and the work you've done up to that point will just be a bunch of unfinished code on your hard drive. On the other hand, if you take something that exists and make it better, you do have a chance of finishing that.
In any case, good luck! I'm not trying to discourage you, just to encourage you to start something you'll be capable of finishing.
Geez, my only question is that will it be free and open sourced?
Friends!
It will be opensource and freely available
We together will build a powerful Os
for that i need your constant support and suggestions
Thanks Texas
But I want to create my own
As You can put your name on it rather than join a new group
where u don't have a say on everything like its name and interface etc.
A nice feature that would help with hardware support would be if you can find a way so it uses the same drivers that are used in a win32 enviorment, just a thought.
Also, if by some miracle, you are able to pull this off, I will take up programing and create an operating system!
lockwolf
the compatibility of drivers depends on the type of environment you are providing
that means the executable files which are provided by the OS
also the filesystem is very important
working on your idea, i suggest that
though i will provide several exe formats in my OS
bu i don't want to use win32 filesystem at present.
though i sufggest that you can emulate or provide a virtual environ for driver to work in you OS projects.
What kind of hardware were you planning to have in these robots? I assuming something like arm processors. I not sure exactly how one is suppose to make a bootloader without knowing the kind how many registers one will work with etc.
| pawelek wrote: |
I would like to test it.
How long are you working on it ??? I think that its hard work to do.
Good luck
Can you advice me, what book is good for beginners in C/C++ ?? |
I suggest you learn C first. C isn't as "friendly" as C++ is. But you get a deeper understanding of what C++ is doing if you know how C works. I recommend deitel and deitel books. They authored the book for my C++ class... pretty good.
Interesting... I have a knowledge in C and C++ but not really in an expert level..
In a small way I can help and be a "tester" of the OS if soon be opensourced..
Best Luck to all of you guys!.. You have my support! Keep us posted for the developments!
________________

Oh yeah, make sure I can play STEAM on it
.
Friends
Building an OS not only requires carefull planning but a defined implementation and standards
So better come out with your new ideas for this new OS
Any techniques -> designing,programming ,almost anything is appreciated.
Wow what an amazing project
Guys go on with it .. ur plans r really cool !!
I can really help with ASM and some C++
I think we should all giv in wutever we can for this opensource and free OS .. and best of All we can have an OS with everything we want and in our way
I am interested in making an Operating System too. Please show it to me when you finish, and, how do you make this GUI in C++? I can't even figure out the bloodshed dev C++ complier's Windows program. Would you be kind enough to give me some advice?
I used to download and try MenuetOS. I think it's programmed by assembly. Should try one time!
I will be posting the source code of A BOOTLOADER soon
It would enable you to boot to system
it will display a picture
and other control and commands
to be executed
thats a rather cool project... ill make sure to keep an eye on this thread so i can see wahts the latest... goodluck guys 
| Code: |
;-----------------------------------------------------------------------------------------------------------------------
;FAT12 BootSector Code for ZION Operating System
;Author: Shirish Goyal <shirishzone@gmail.com>
;Date: August 21,2005
;-----------------------------------------------------------------------------------------------------------------------
;Initializes the system
;Finds a file Loader.bin in FAT12 Floppy and loads it in RAM at 0x0500:0000
;Execute the Loader from RAM
;-----------------------------------------------------------------------------------------------------------------------
[BITS 16]
BOOTSEG equ 0x07C0
STACKSEG equ 0x9000
STACKLIMIT equ 0xFFFF
LOADERSEG equ 0x0050
ROOTOFFSET equ 0x0200
;-------------------------------------------------
;set the Print Character Constants
;-------------------------------------------------
CR equ 0x0D
LF equ 0x0A
;-------------------------------------------------
[ORG 0x0000]
;----------------------------------------------------------------------------------------------------------------------
;FAT12 Boot Parameter Block
;----------------------------------------------------------------------------------------------------------------------
jmp start
OEMName db "ZION OS"
BytesPerSector dw 0x0200 ;Bytes Per Sector = 512 bytes
SectorsPerCluster db 0x01
ReservedSectors dw 0x0001 ;Reserved Sectors at Start of Floppy including bootsector
TotalFATs db 0x02
MaxRootDirEntries dw 0x00E0
TotalSectorsSmall dw 0x0B40
MediaDescriptor db 0xF0
SectorsPerFAT dw 0x0009
SectorsPerTrack dw 0x0012
TotalHeads dw 0x0002
HiddenSectors dd 0x00000000
TotalSectorsLarge dd 0x00000000
PhysicalDrive db 0x00
Flags db 0x00
Signature db 0x29
VolumeId dd 0xFFFFFFFF
VolumeLabel db "ZION BOOT"
FATSystemType db "FAT12 "
;----------------------------------------------------------------------------------------------------------------------
start:
cli ;disable interrupts before setting segment registers
mov ax,BOOTSEG
mov ds,ax
mov es,ax ;setup all Segment registers to start of Bootsector
mov fs,ax ;at location 0x7C00:0000
mov gs,ax
mov ax,STACKSEG
mov ss,ax ;setup stack at 0x9000:0000
mov sp,STACKLIMIT ;SP points to 0x9000:FFFF i.e. End of Free RAM
sti ;enable interrupts
;------------------------------------------------------------------------------------------------------------------
mov si,msgLoading ;show welcome message
call PrintMessage
|
| Code: |
------------------------------------------------------------------------------------------------------------------
;Load Root Directory Region after BootSector at 0x7C00:0200 0x200=512 bytes
;Steps Required:
;1. Calculate Number of Sectors used by Root Dir Region and store in CX
;2. Find the location of Root Dir Region in FAT12 Structure and store in AX
;3. Read Root Dir Region and store to RAM at 0x7C00:0200
;------------------------------------------------------------------------------------------------------------------
LoadRootDir:
;Step 1: Calculating No. of Sectors used by RootDir Region
;Sectors used = (Size of Entry in bytes * No. of Entries)/Bytes per sector
xor cx,cx ;initialize CX and DX
xor dx,dx
mov ax,0x0020 ;Each Root Dir Entry is 32 bytes(0x0020) in size
mul word [MaxRootDirEntries] ;find size of Root Dir Region
div word [BytesPerSector] ;find no. of sectors used by Root Dir Region
xchg ax,cx ;store value in CX and initalize AX for next operation
;Step2: Finding the location of Root Dir Region in FAT12 Structure
;Location = Reserved Sectors + FAT Region Sectors
mov al,byte [TotalFATs ]
mul word [SectorsPerFAT] ;find no. of sectors used by FATs
add ax,word [ReservedSectors] ;store Location of Root Dir Region in AX
mov word [DataAreaStart],ax
add word [DataAreaStart],cx ;find location of Data Region for loading Loader later and save it
;Step3. Read Root Dir Region and store to RAM at 0x7C00:0200
;use ReadSectors routine using CX for Sector count , AX for Sector location and BX for location in RAM
mov bx,ROOTOFFSET
call ReadSectors
FindLoader:
;check the root directory for root entry for loader
mov cx,word [MaxRootDirEntries] ;initialize loop counter
mov di,ROOTOFFSET ;goto first root entry
.FindLoop:
push cx
mov cx,0x000B ;Loader file has a 11 Character name
mov si,LOADERNAME ;save loader name to SI
push di
rep cmpsb ;compare SI with DI at byte level
pop di
je LoadFATRegion ;if loader found then load FAT to find its cluster chain
pop cx
;continue till loader found or all entries searched
add di,0x0020 ;mov to next entry of 32 bytes
loop .FindLoop ;decrement CX and continue till CX = 0
.Absent:
jmp LoaderFail |
| Code: |
;------------------------------------------------------------------------------------------------------------------
;Load FAT Region for reading the Cluster chain of Loader
;Stores FAT Region with Sector Count CX, starting from location AX in FAT Strcture at location ES:BX in RAM
;Steps Required:
;1. Find Number of Sectors used by FAT Region
;2. Find location of FAT Region in FAT Structure
;3. Set Location of FAT in RAM
;------------------------------------------------------------------------------------------------------------------
LoadFATRegion:
;save first cluster of Loader to conserve RAM space
;by overwriting Root Region in RAM by FAT Region at 0x07C0:0200
mov dx,word [di+0x001A] ;Cluster is stored at offset 26 in Root Entry
mov word [Cluster],dx ;Save First Cluster of Loader
;Step1: Find Number of Sectors used by FAT Region
;Sector Count=TotalFATs * SectorsPerFAT
xor ax,ax ;initialize AX
mov al,byte [TotalFATs]
mul word [SectorsPerFAT]
mov cx,ax ;Sector Count stored in CX
;Step1: Find location of FAT Region in FAT Structure
;Location=ReservedSectors+TotalFATSectors
mov ax,word [ReservedSectors] ;Location in AX ///////////////////////////////////////
;Step3. Set Location of FAT in RAM
mov bx,ROOTOFFSET
call ReadSectors
;------------------------------------------------------------------------------------------------------------------
;------------------------------------------------------------------------------------------------------------------
LoadLoaderImage:
;Set location for Loader in RAM
mov ax,LOADERSEG ;load Loader at 0x0050:0000 i.e. start of Free RAM
mov es,ax
mov bx,0x0000 ;set IP for Loader Code
push bx
.LoaderLoop:
;Read sectors of Data Region corresponding to Cluster of Loader
;AX:starting location, CX:Sector Count, BX:Offset of Segment used in RAM
mov ax,word [Cluster]
pop bx ;BX stores location to write in RAM
call FAT2LBA ;AX stores location of Sector to be Read
xor cx,cx
mov cl,byte [SectorsPerCluster] ;CX stores no. of sectors to read
call ReadSectors
push bx
;Find out next Cluster in Chain
;Each Cluster of 12 bits and hence Location of next cluster is at 3/2 of Cluster
;Location= Cluster+(Cluster>>1)
mov ax,word [Cluster]
mov cx,ax
mov dx,ax ;used for shifting
shr dx,0x0001
add cx,dx ;CX stores location of cluster
mov bx,ROOTOFFSET ;Location of FAT Region in RAM at 0x07C0:0000
add bx,cx ;BX stores location of next cluster in RAM
mov dx,word [BX] ;DX stores next cluster value
;Each Cluster is of 12 bits
;For finding correct value of the next cluster from the pseudo cluster value, steps required:
;For Odd Cluster, take upper 12 bits of pseudo cluster value by right shifting
;For Even Cluster, take lowest 12 bits of pseudo cluster value by logical AND
test ax,0x0001 ;check if cluster odd or even
jnz .OddCluster
.EvenCluster:
and dx,0000111111111111b
jmp .ClusterLoop
.OddCluster:
shr dx,0x0004
.ClusterLoop:
mov word [Cluster],dx ;store new cluster
cmp dx, 0x0FF0 ;check if EOF
jb .LoaderLoop
.Complete:
push word LOADERSEG ;save Segment and offset values to stack to enable jump by retf
push word 0x0000
retf ;load Loader's SEG:OFFSET value from stack and execute code |
| Code: |
;------------------------------------------------------------------------------------------------------------------
LoaderFail:
mov si,msgLoaderFail
call PrintMessage
jmp Fail
Fail:
mov si,msgReboot ;show message for reboot
call PrintMessage
mov ah,0x00 ;call BIOS Keyboard Service
int 0x16 ;Wait for Keyboard input
int 0x19 ;Reboot System
;----------------------------------------------------------------------------------------------------------------------
;FAT to LBA Routine
;Converts FAT Cluster no. in AX to corresponding Sector No. and store in AX
;LBA Sector= (FAT Cluster-2)*SectorsPerCluster+DataRegionLocation ;First 2 clusters are reserved for FAT12
;----------------------------------------------------------------------------------------------------------------------
FAT2LBA:
sub ax,0x0002
xor cx,cx
mov cl,byte [SectorsPerCluster] ;convert byte to word before multiplying
mul cx
add ax,word [DataAreaStart]
ret
;----------------------------------------------------------------------------------------------------------------------
;LBA to CHS Addressing Routine
;Converts Linear Sector No. in AX to CHS(Cylinder ,Head,Sector) Scheme
;Sector= (LBA Sector(AX) mod SectorsPerTrack)+1 ;Sectors start from 1
;Head = (LBA Sector/SectorsPerTrack)mod TotalHeads
;Cylinder= (LSector/SectorsPerTrack)/TotalHeads
;DIV Operation: Quotient:AX Remainder:DX
;----------------------------------------------------------------------------------------------------------------------
LBA2CHS:
xor dx,dx ;set DX=0 for storing Remainder for DIV Operation
div word [SectorsPerTrack]
inc dl
mov byte [Sector],dl ;find Sector in CHS
xor dx,dx ;set DX to 0 again
div word [TotalHeads]
mov byte [Head],dl ;find Head in CHS
mov byte [Cylinder],al ;find Cylinder in CHS
ret |
May I know which compiler to use for this code? TASM? NASM?
What features do you plan on implementing and what type of o/s will it most likely be?
I already answered those questions earlier
Well you can give your own suggestions
The code for bootloader is specially for NASM as it is open source too
I am using only open source tools to build my OS.
do you have a website to show progress on your OS?
if you don't you should, it would allow much better feedback than in this forum thread, and more people could see your work.
Keep up the good work.
Actually I am working on that part only due to which the project got delayed
I am creating a wiki on my OS
Thanks for interest in the OS
Keep in touch
Just a question of curiosity. Why would one write his own os when lots of os are lying around, and many of them are opensource (like linux, freebsd, etc)?
will this be a Windows rip off 
| Quote: |
will this be a Windows rip off  |
No one would like to create a software which is a direct ripoff of another software. I do not suppose the creator of this OS would like to copy windows too much, may only include functions that may prove useful.
I am not using any pre-available designs in my OS like that of Windows
Though I am starting off with Windows Filesystem fat32 which i will change later on
I hope someone will post pictures of new interface designs here for my help
Did anyone checked out the code I posted
Actually it was incomplete
Its two functions are left for posting though I have created them.
keep up the good work... really ambitious
Wow, good luck! That's a huge project to build your own OS! Will it be able to run on Apple hardware? Also, will it be able to run other OS applications natively (like OS/2 could)? This could be interesting to watch... I still don't know if I would trust anything not UNIX based, but we'll see I guess...
BTW will it be open source?
Good Luck with it 
I suppose we could start off with creating CLI rather GUI first? Because we could test out any problem with the kernel and stuffs before dealing with the GUI.
What kind of features are u looking for CLI
Main point of starting with GUI is because I want to start up on SVGA high resolution
and i am still stuck on that.
If someone can help out svga in assembly, plz do
Bye
We could use an display architecture like linux, client & server architecture.
Although linux only use client server for GUI, i was thinking of using client server for CLI too, this would eliminate the need for "telnet" and such. Unless you planning on developing a desktop OS. I suppose the CLI OS kernel could start from functions like booting into 32bit, whereas the bootloader only boots to 16bit, some sort of 2 tier booting. Following up could be functions to disk access, memory management, and task management, forgive me if you plan only to work on real time OS. If it's RTOS, then i suppose function like accessing the clock and text editor would be a great start.
for a gui a really simple interface would be awesome (and easier to program) such as the win 95 bar, but without all the crashing 
| Texas Al wrote: |
What is going to be different between your OS and the dozens that are available out there (and I'm not just talking about Linux, Unix, and BSD variants, the dozens of other OS).
One of two possibilities exist. Either you are an experienced systems programmer or you aren't.
If you aren't an experienced programmer, you'll learn a lot, but it will take you forever just to make the OS work, let alone make it better. Still it's a worthwhile thing to take a stab at... if you get stuck, study some of the other open source OS's and see how they did it.
If you are an experienced programmer, you're wasting your talent! Join an existing OS project and add the features you'd like to see. If they don't accept your changes, fork your project, but at least you won't be starting from nothing! If you're interested in writing kernel stuff at least you'll have the higher level functionality of the existing OS you can put on top of it and immediately have something that is useful. If you're interested in writing something higher level, like a window manager or a file system, you can use it with the existing kernel.
I know I sound like one of those cranky people who are saying "It's impossible, it will never work!"
That's not my intention. Operating systems have been written before, so it's possible... I'm just saying that when you see the sheer amount of work this takes, you'll give up, and the work you've done up to that point will just be a bunch of unfinished code on your hard drive. On the other hand, if you take something that exists and make it better, you do have a chance of finishing that.
In any case, good luck! I'm not trying to discourage you, just to encourage you to start something you'll be capable of finishing. |
Is there a way to download and install linux, and have the operating system list
at startup appear in a certain order?
I want the list of OS's to look like this:
Microsoft Windows XP Pro
Microsoft Windows Recorvery Consell
Linux
I dont really need to chage the name of the OS's, but I do need to be able to easily uninstall it, not damage the computer, and have the list in this exact order.
If this requires editing a VERY important system file, then i'll just keep using knoppix.
Also, can you set Linux to install to a directory on my computer, instead of a HD partion? I *really* want to keep all my file and NOT reformat.
If anyone needs more info, I'll be watching the post.
Thats so awesome. I would like to create one too. I would look forward for the 'release' of your Operating System.
gamo, you could install a boot loader, the common ones used for multi os booting system are grub and lilo..it would need 2 go some configurations to work tho. Unless u install an distro that includes the bootloader, maybe it would help you to setup through it's setup scripts or system.
This is a realy great idea and I would like to say it would all kinds of kool if you could make it better than windows! LOL
umm wouldnt it be hard to make drivers without getting a lawsuit
Learn more from this forum!
Thank you!
Does making your own driver for hadwarre will get you a lawsuit? I hope not, i suppose since it's free and meant for learning purposes and non-comercialize, it would b fine.
I did try to do some screen drawing with bios interrupt. I will post them as soon as I get home from work. 
Hmm Very interesting idea
I suppose all those free OS's came from somewhere so goodluck and I will keep watching development, I think if I get your idea right you will allow it to be cutomised which is something I do alot with windows.. but it usually requires editing stuff you shouldnt actually play with and using third party software.
Hmm, i wondered where my source code for vga drawing went to. Will post again when i find it.
friends
finding svga help for initial startup is really a terrible problem
I tried a lot but drawing in svga like windoews or linux do is a lot dfficult
I f anyone has any comments do tell me
well i will try to load svga mode after loading total os if everything fails
Do provide links here of help available
also provide any other fetures u want at this stage
do give ur own source cxode if u have
it will b a great help
| Shirish wrote: |
friends i am posting this bcz i m running short of points
please excuse me
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit
friends
keep posting
sorry for the delay of one month due to loss of internet connection
i have created several files
if any one of u know how to play with svga code inn asm
please write down the method here so that all can benefit |
Admins should look into this lol.. Spamming for points..
idk... this is one of the more productive threads in the forums... unlike all the "tell us your hardware specs" etc. ones...
Friends.
I am posting the code for second stage bootloader here
This loader loads a file loader.exe from the floppy and then loads kernel .exe from floppy
Besides it puts system in protected mode and initialization of svga is still to be done
| Code: |
;-----------------------------------------------------------------------------------------------------------------------
;FAT12 BootSector Code for ZION Operating System
;Author: Shirish Goyal <shirishzone@gmail.com>
;Date: August 21,2005
;-----------------------------------------------------------------------------------------------------------------------
;Initialize VESA Mode
;Initializes Protected Mode [32 bit]
;Finds a file Kernel.exe in FAT12 Floppy and loads it in RAM at :0000
;Execute the Kernel from RAM
;-----------------------------------------------------------------------------------------------------------------------
[BITS 16]
BOOTSEG equ 0x07C0
STACKSEG equ 0x9000
STACKLIMIT equ 0xFFFF
LOADERSEG equ 0x0050
ROOTOFFSET equ 0x0200
IMAGESEG equ 0x6400
[ORG 0x0000]
jmp start
start:
cli
mov ax,LOADERSEG
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ax,STACKSEG
mov ss,ax
mov sp,STACKLIMIT
sti
call ClearScreen
mov si,msgSuccess
call PrintMessage
|
| Code: |
;------------------------------------------------------------------------------------------------------------------
mov si,msgLoading ;show welcome message
call PrintMessage
;------------------------------------------------------------------------------------------------------------------
;Load Root Directory Region after BootSector at 0x7C00:0200 0x200=512 bytes
;Steps Required:
;1. Calculate Number of Sectors used by Root Dir Region and store in CX
;2. Find the location of Root Dir Region in FAT12 Structure and store in AX
;3. Read Root Dir Region and store to RAM at 0x7C00:0200 |
| Code: |
;------------------------------------------------------------------------------------------------------------------
LoadRootDir:
;Step 1: Calculating No. of Sectors used by RootDir Region
;Sectors used = (Size of Entry in bytes * No. of Entries)/Bytes per sector
xor cx,cx ;initialize CX and DX
xor dx,dx
mov ax,0x0020 ;Each Root Dir Entry is 32 bytes(0x0020) in size
mul word [MaxRootDirEntries] ;find size of Root Dir Region
div word [BytesPerSector] ;find no. of sectors used by Root Dir Region
xchg ax,cx ;store value in CX and initalize AX for next operation
;Step2: Finding the location of Root Dir Region in FAT12 Structure
;Location = Reserved Sectors + FAT Region Sectors
mov al,byte [TotalFATs ]
mul word [SectorsPerFAT] ;find no. of sectors used by FATs
add ax,word [ReservedSectors] ;store Location of Root Dir Region in AX
mov word [DataAreaStart],ax
add word [DataAreaStart],cx ;find location of Data Region for loading Loader later and save it
;Step3. Read Root Dir Region and store to RAM at 0x7C00:0200
;use ReadSectors routine using CX for Sector count , AX for Sector location and BX for location in RAM
mov bx,ROOTOFFSET
call ReadSectors |
| Code: |
FindKernel:
;check the root directory for root entry for loader
mov cx,word [MaxRootDirEntries] ;initialize loop counter
mov di,ROOTOFFSET ;goto first root entry
.FindLoop:
push cx
mov cx,0x000B ;Loader file has a 11 Character name
mov si,KERNELNAME ;save loader name to SI
push di
rep cmpsb ;compare SI with DI at byte level
pop di
je LoadFATRegion ;if loader found then load FAT to find its cluster chain
pop cx
;continue till loader found or all entries searched
add di,0x0020 ;mov to next entry of 32 bytes
loop .FindLoop ;decrement CX and continue till CX = 0
.Absent:
jmp KernelLoadFail
; |
| Code: |
------------------------------------------------------------------------------------------------------------------
;Load FAT Region for reading the Cluster chain of Loader
;Stores FAT Region with Sector Count CX, starting from location AX in FAT Strcture at location ES:BX in RAM
;Steps Required:
;1. Find Number of Sectors used by FAT Region
;2. Find location of FAT Region in FAT Structure
;3. Set Location of FAT in RAM
;------------------------------------------------------------------------------------------------------------------
LoadFATRegion:
;save first cluster of Loader to conserve RAM space
;by overwriting Root Region in RAM by FAT Region at 0x07C0:0200
mov dx,word [di+0x001A] ;Cluster is stored at offset 26 in Root Entry
mov word [Cluster],dx ;Save First Cluster of Loader
;Step1: Find Number of Sectors used by FAT Region
;Sector Count=TotalFATs * SectorsPerFAT
xor ax,ax ;initialize AX
mov al,byte [TotalFATs]
mul word [SectorsPerFAT]
mov cx,ax ;Sector Count stored in CX
;Step1: Find location of FAT Region in FAT Structure
;Location=ReservedSectors+TotalFATSectors
mov ax,word [ReservedSectors] ;Location in AX
;Step3. Set Location of FAT in RAM
mov bx,ROOTOFFSET
call ReadSectors |
| Code: |
;------------------------------------------------------------------------------------------------------------------
LoadKernelImage:
;Set location for Loader in RAM
mov ax,IMAGESEG ;load Loader at 0x0050:0000 i.e. start of Free RAM
mov es,ax
mov bx,0x0000 ;set IP for Loader Code
push bx
.LoaderLoop:
;Read sectors of Data Region corresponding to Cluster of Loader
;AX:starting location, CX:Sector Count, BX:Offset of Segment used in RAM
mov ax,word [Cluster]
pop bx ;BX stores location to write in RAM
call FAT2LBA ;AX stores location of Sector to be Read
xor cx,cx
mov cl,byte [SectorsPerCluster] ;CX stores no. of sectors to read
call ReadSectors
cmp bx, 1024 ; Segment override (64kb)
jne .SegmentOk
mov ax, es ; next segment ( add 64)
add ax, 64
mov es, ax
mov bx, 0
|
| Code: |
.SegmentOk:
;Find out next Cluster in Chain
;Each Cluster of 12 bits and hence Location of next cluster is at 3/2 of Cluster
;Location= Cluster+(Cluster>>1)
push bx
mov ax,word [Cluster]
mov cx,ax
mov dx,ax ;used for shifting
shr dx,0x0001
add cx,dx ;CX stores location of cluster
mov bx,ROOTOFFSET ;Location of FAT Region in RAM at 0x07C0:0000
add bx,cx ;BX stores location of next cluster in RAM
mov dx,word [BX] ;DX stores next cluster value
;Each Cluster is of 12 bits
;For finding correct value of the next cluster from the pseudo cluster value, steps required:
;For Odd Cluster, take upper 12 bits of pseudo cluster value by right shifting
;For Even Cluster, take lowest 12 bits of pseudo cluster value by logical AND
test ax,0x0001 ;check if cluster odd or even
jnz .OddCluster |
Nice, i think i will try and port these codes to my zaurus, which is left in the dust
Sounds awesome. I know some stuff in C. If you have any questions let me know.
I, myself, made an OS. Only it was made with 100% ASM. It was basically like MenuetOS, which is a free OS made with ASM, except it had various improvments. It was just something to call my own, that I had fun making.
Good luck, hollar if you need anything.
PM me when you get a BETA and ill test it out!
Sounds really cool - good luck guys!
Either I havent been paying attention or just not visiting this section but its been a while since I looked at this topic and I cant wait for release of this! Keep up the good work!
Shirish, it's interesting what you're doing, but since you're on Frihost, why don't you start a website for presenting your project ? With full explanaitions, screenshots and such.
I'm fascinated by operative systems (except for ms windows), and I enjoyed to see the ultra compact menuetos. Why don't you collaborate to one of them ? (menuetos, syllable, haiku and such)
There is a good list there ;
http://en.wikipedia.org/wiki/List_of_operating_systems
I could help you test it out when it's ready for beta testing. Just drop me a message in my PM inbox 
Same. I'll be testing it on old hardware like 286, 386, 486, P1, P2 and P3.
Nice listing of old PCs, i too have a few pentium 1s and 2s, 386 486..i just do not know what to be done to them. Maybe i will try to create beowulf. Shirish, be sure to post your website url soon.
Damn, i hate to work, else i would have started on my own OS.
You can put light Linux distros on them or other free OSes.
Haha, i did get linux on them, but i can't find a purpose for them. Until i do, they are left there in the dust.
First off I wish you well in your endeviors.
Good luck.
Lately I have been using XANDROS, and I must admit that it is ok
But it still dosen't match XP, as much as I regret to admit it.
I hope that someone will give us hope. I don't like the way that BG has gained control of the PC world, but other OS's just don't measure up.
The user innerface must be a real hard task.
I like XANDROS but it still is slower and less friendly than XP.
Good Luck and I will be watching your progress.
No help for lack of knowledge, but very hopeful for something better to be offered to the PC world 
Its true, you have alot of people willing to Beta test but not enough capable of making this.
Shirish-
you might have better luck if you looked around or posted in developer forums. Frihost people are mostly knowledgeble in things like HTML, CSS, Java etc... (web languages) Good Luck. 
Hi. This is a hell of a challenging project.
But I miss some things :
- I see a small list of proposed features, but I don't see the big picture. What platforms is it meant for (what cpu's, embedded,...), who will use this OS (general users, graphical designers, developers,...),... A common mistake with projects is not to determine the scope. You start writing a bootloader, without really knowing the next steps.
- This seems like a solo project : you write your code on your machine, without using a repository (like cvs). This makes it impossible to join forces and collaborate. Moreover, you ask everyone to send code for a bootloader : so basically you stimulate individual efforts instead of working together. I strongly advice using some good collaborative infrastructure, like sourceforge (www.sf.net).
- A technical design of the system would be interesting. How do you see the system, of which parts does it consist, how do these parts communicate to each other, what type of multithreading will be used,...
- I don't see anything about security, although this should be a key issue.
- ...
If you really want to make this a successful project, you'd better first think about it, and only start programming when you have a clear vision.
Good luck !
very cool....keep us updated on whats happening....i would like to see where this thing goes...btw how do u get time to work on it, this is like a 24/7 committment?
I suppose Shirish are interested in making the OS for educational purpose, i would say it will not match closely to any of the leading OS in the market now, but it will be a great learning experience. Shirish need our support in exchange of his motivation in the development of the OS. =) I'm willing to help, so tell me if you need me on the crew.
l've got an old 12gb win98 sittin in the other room gathering dust, if you have drivers to make the speakers work so that 5gigs of music l put on it forever ago doensn't go to waste, then l would be happy to beta test it for ya
i'll try my best to run that on my pc
you can use it too when made, free
Friends
You can send me different libraries in C
which will form the core library of OS
the more libraries you send more better support it will provide to varied applications
take care to send libraries which are compatible with gnu C
I really don't believe in writing a new os when there are plenty of them -- really good ones like linux with source code available -- around. But I appreciate the enthusiasm of you people trying to put effort into something like this. I have been seeing this thread going on for a while with absolutely no progress. Statements like "we need to get a solid design first" "we should think of security" in the posts won't help. Here is a suggestion.
One of you (sirish should be the one i guess) should create a cvs repository somewhere and grant access to people who will work on this. A document sould be created. It need not be an elaborate doc but might define just scope, environment, overview, target, etc and may consist of details of other documents to come regarding design (high level, low level, etc). Then documents can be created for each of them as and when required and uploaded to cvs.
Once this process is started, people keep updating the document and after a while it will become more clear as to how things can proceed.
It will be better if a standard format is defined for the documents uploaded. This way, all the documents by different people will be consistent.
Good luck guys!
I appreciate the views of ky
Even though cvs is a good point
but i don;t like them personally for the slow access rate they provide
I will start my own website instead where the ppl will be able to post their matter about the OS
Thanks for your views .
Hello Friends
So the OS Work is going on its full scale.
I will be presenting the initial version by end of this month
So keep watching this group.
Also there is interesting news for all of you
that i am finally launching my Frihost site
www.digitalmind.frihost.net
Please check that out by end of this week i.e 21 Jan 2006
By then Cheers to all and Wish u a nice day
Here is code for gdt.cpp
| Code: |
#include <kernel/GDT.h>
void GlobalDescriptorTable::DefineDescriptor(int num,unsigned long base,unsigned long limit,segmentTypeBit segmentType,descriptorTypeBit descriptorType,privilegeBit privilegeLevel,presentBit present,unsigned char granularity)
{
GlobalDescriptor *gd = (GlobalDescriptor *) GDT_BASE + num;
gd->SegmentLimitLow=(limit & 0xFFFF);
gd->SegmentBaseLow=(base & 0xFFFF);
gd->SegmentBaseMid=((base>>16) & 0xFF);
gd->SegmentType=segmentType;
gd->DescriptorType=descriptorType;
gd->PrivilegeLevel=privilegeLevel;
gd->Present=present;
gd->SegmentLimitHigh=((limit>>16)& 0xFF);
gd->Granularity=granularity;
gd->SegmentBaseHigh=((base>>24) & 0xFF);
}
void GlobalDescriptorTable::CreateTable()
{
/*DefineDescriptor(
int num,
unsigned long base,
unsigned long limit,
segmentTypeBit segmentType,
descriptorTypeBit descriptorType,
privilegeBit privilegeLevel,
presentBit present,
unsigned char granularity)
*/
//NULL Descriptor
DefineDescriptor(0,0,0,RES_1,SYSTEM,RING0,ABSENT,0);
//CODE Descriptor
DefineDescriptor(1,0,0x000FFF,RES_3,CODE_DATA,RING0,PRESENT,0x000C);
//DATA Descriptor
DefineDescriptor(2,0,0x000FFF,LDT,CODE_DATA,RING0,PRESENT,0x000C);
for(int index=3;index<256;index++)
{
DefineDescriptor(index,0,0x000000,RES_1,SYSTEM,RING0,ABSENT,0x000C);
}
}
void GlobalDescriptorTable::LoadGDTR()
{
GDTRegister GDTR;
GDTR.Limit=(unsigned short int)GDT_LIMIT;
GDTR.BaseLow=(unsigned short int)GDT_BASE_LOW;
GDTR.BaseHigh=(unsigned short int)GDT_BASE_HIGH;
asm("lgdt (%0)": :"p" (&GDTR));
}
void GlobalDescriptorTable::Initialize()
{
CreateTable();
LoadGDTR();
asm("mov $0x0010,%ax");
asm("mov %ax,%ds");
asm("mov %ax,%ss");
asm("mov %ax,%es");
asm("mov %ax,%gs");
asm("mov %ax,%fs");
}
|
Code for gdt.h
| Code: |
typedef enum present_tag
{
ABSENT=0x00,
PRESENT=0x01
}presentBit;
typedef enum descriptor_privilege_tag
{
RING0=0x00,
RING1=0x01,
RING2=0x02,
RING3=0x03
}privilegeBit;
typedef enum descriptor_type_tag
{
SYSTEM=0x00,
CODE_DATA=0x01
}descriptorTypeBit;
typedef enum segmentTypeBit
{
RES_1=0x00, TSS_16A=0x01, LDT=0x02, TSS_16B=0x03,
CALL_GATE_16=0x04, TASK_GATE=0x05, INT_GATE_16=0x06,
TRAP_GATE_16=0x07, RES_2=0x08, TSS_32A=0x09,
RES_3=0x0A, TSS_32B=0x0B, CALL_GATE_32=0x0C, RES_4=0x0D,
INT_GATE_32=0x0E, TRAP_GATE_32=0x0F
};
/********************************* Descriptor **********************************
BASE:
It defines thee location of Segment in the 4GB Linear Address Space.
Three fragments are concatenated to form a single 32bit value.
LIMIT:
It defines the size of Segment.
Two fragments on concatenation give a 20bit value.
GRANULARITY:
It defines the units with which LIMIT is interpreted.
0: Units of 1byte LIMIT:1Mb
1: Units of 4Kb LIMIT:4GB
TYPE:
It defines various types of Descriptors.
DESCRIPTOR PRIVILEGE LEVEL:
It defines the protection level.
SEGMENT-PRESENT:
It defines if the segment can be used for addressing.
0:Not valid
1:Valid
ACCESSED:
It defines if the segment has been accessed.
0:Not accessed
1:Accessed
*******************************************************************************/
typedef struct GlobalDescriptor
{
unsigned short int SegmentLimitLow;
unsigned short int SegmentBaseLow;
unsigned char SegmentBaseMid;
segmentTypeBit SegmentType:4;
descriptorTypeBit DescriptorType:1;
privilegeBit PrivilegeLevel:2;
presentBit Present:1;
unsigned char SegmentLimitHigh:4;
unsigned char Granularity:4;
unsigned char SegmentBaseHigh;
};
typedef struct GDTRegister
{
unsigned short int Limit;
unsigned short int BaseLow;
unsigned short int BaseHigh;
};
class GlobalDescriptorTable
{
private:
void LoadGDTR();
void CreateTable();
void DefineDescriptor(int num,unsigned long base,
unsigned long limit,
segmentTypeBit segmentType,
descriptorTypeBit descriptorType,
privilegeBit privilegeLevel,
presentBit present,
unsigned char granularity);
public:
void Initialize();
}; |
will an iso of your operating system be available on your website ? I've just visited it, but there are some missing php files everywhere.
With an iso file, we'll be able to test it wih qemu for example.
Then you can post your projet at :
http://free.oszoo.org/index-2.html
Very good initiative !
i hope you will succeed in writing a new OS.
It must be very interesting and very exciting writing C code that works.
I can only use Perl and it will takes me some time to learn C .
ya friends
it is great to find your kernel working
though i have the basic version which can start from grub
it can display logo in text
and then shows the info passed by grub
i am now working on memeory management
hope to include vesa facility soon
lets's see
im a begginer at photoshop and real basic 2005
Hey friends
I completed maximum of the part within last week
You can design logos for it if you re a designer
I have named it "Shunya"- it means zero in English
Well i will post the binary soon as soon as i complete the Interrupts part.
Then i will continue with keyboard.
I would love to help with this. I will do all the beta testing that you need. Is there a link to this OS so i can see the progress?
I haven't read all of the posts, but I saw some people asking on how to learn programming. I suggest you do not start with C or C++ if you are completely new to programming. Rather, start with something easier to learn like Visual Basic or Python. That way, the concepts you learn in the easier language will transfer over to C or C++, as they are pretty much the same, the syntax will be completely different though.
Something to try:
Multi-Platform Application Compatibility-
So we can use our Windows, Mac, or Linux apps on one OS!!
Edit:
Made a logo for ya!
[img]http://www.phantomware.frih.net/images/shunya_bw.bmp[/img]
Friend
D77000 posted a picture
Well thanks for the attempt
but It didn't meet the requirements of a high profile designer
Send only good entries in future.
Also the initial version can be askd for at your email
I will mail you one.
If you guys need a god logo, i would love to make you one. What sort are you looking for?
A bit more colorfull than the last post i hope?
I can do quite some DTP and am a photographer, and quite good with photoshop. So just let me know.....
So when will the system be ready for use?
| Shirish wrote: |
Friends I am working on building a fully functional Operating System from Scratch. Anyone who is interested can contact me or post in the forum
I am presently using Nasm as Assembler for bootloader
and C/C++ for Kernel Coding
It will be protected mode OS with a New GUI in high Resolution working on SVGA
Development has started and the source code will be published soon
of the modules i write or complete
Viewers can provide more optimized routines or ask any questions for their projects |
where r u from in India ? may be we can meet. can't we ?
Hey Friends
I am from India
I study in Guru Nanak Dev university,Amritsar, Punjab
doing B.Tech Computer Sci.
I love Image Processing, Robotics, Operating Systems and any Core Computer Studies.
All those proficient in DTp and Photoshop
They can try some cool wallpapers if they want to see them in my OS
They must be innovative and contain a "Zero" that is O
So use your imagination and you may win 50 Fri$ each whose entry is used in OS
Please help in the task
If you can create good website in php with good features like uploading html files which would be dispalayed as enteriesds on pages and which on clicking display those html files
I can give you 100 fri$ for that .Grphics work would be done by me.
You can just do the coding work . Although I have accomplished the work bu t i don't have time to do rest of the work myself.
S o if you can help just contact me on email given above.
| Arnie wrote: |
| Got a hardware req list? |
(of your OS, so I know what sort of machine to reserve for it.)
I would very much like to do bete testing. . . please contact me!
Friends in the following postings , I will be listing the different requirements and features of Shunya OS
Prerequisites
Hardware Requirements
‘Shunya’ is based on x86 Intel Platform and requires minimum of hardware to operate. Actually in that terms, it can be said that most of the requirements have become standards in Industry today and it would be difficult to find a PC which doesn’t satisfy the environment. As the OS has not been tested on AMD based PC’s , hence nothing can be said about it. Well it can be extended easily for AMD too as it based on Object Oriented Concept and uses Machine level instruction to bare minimum for maximum compatibility. The list below provides the minimum hardware requirements for execution of OS.
Intel 80386,80486,Pentium based PC
(Other Systems which based on Intel Architecture and x86 Instruction Set may be supported too).
Color VGA Monitor
Shunya utilizes color text mode for initial startup. In future versions , VESA Interface may be provided.
A Standard 101 key AT Keyboard and Controller
Shunya controls the A20 Address Line through Keyboard Serial Controller. Though code can be changed based on System Manufacturer Documentation.
Minimum 1 MB RAM
Shunya can support maximum of 4GB RAM through Protected Mode by enabling A20 Address Line. Though minimum 1MB RAM is required for bare operation even for Real Mode.
A Standard 1.44 MB Floppy Drive
A Floppy Drive is required to boot the System using Kernel binary which is in form of Floppy Image created using PartCopy utility.
--
Development Tools & Environment
DJGPP Compiler
DJGPP, an acronym for DJ's GNU Programming Platform developed by DJ Delorie, is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS. DJGPP is Free C++ Compiler including ports of many GNU development utilities. The ported GNU packages are, free and, the library and utilities developed specifically for DJGPP, are distributed under the GNU license. DJGPP supports platforms having a huge installed base, and it is highly popular among MS-DOS/MS-Windows users.
Nasm Assembler
NASM is an open source x86 assembler designed for portability and modularity. It supports a range of object file formats including Linux a.out and ELF, COFF, Microsoft 16-bit OBJ and Win32.
Ld Linker
Ld combines a number of object and archive files, relocates their data and ties up symbol references. Ld accepts Linker Command Language files written in a superset of AT&T's Link Editor Command Language syntax, to provide explicit and total control over the linking process.
Different formats may be linked together to produce any available kind of object file. Aside from its flexibility, the GNU linker is more helpful than other linkers in providing diagnostic information. Many linkers abandon execution immediately upon encountering an error; whenever possible, Ld continues executing, allowing you to identify other errors (or, in some cases, to get an output file in spite of the error).
Bochs Emulator
Bochs is a highly portable open source Cross Platform IA-32 Emulator written in C++, which runs on most popular platforms. It includes emulation of the Intel x86 CPU, common I/O devices, and custom BIOS. Currently, Bochs can be compiled to emulate a 386, 486 or Pentium CPU. Bochs is capable of running most Operating Systems inside the emulation including Linux, Windows® 95, DOS, and recently Windows® NT 4. Bochs was written by Kevin Lawton .The 'typical' use of Bochs is to provide complete x86 PC emulation, including the x86 processor, hardware devices, and memory. This allows you to run OS's and software within the emulator on your workstation, much as if you have a machine inside of a machine
SciTE Editor
SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs.
SciTE is currently available for Intel Win32 and Linux compatible operating systems with GTK+.
PartCopy
PartCopy is a free utility which creates image of Floppy or Hard-Disk which can be used for Distribution purposes or testing on Emulator. Though there are other utilities which support same feature like Raw-Write provided free under GNU License. A utility for creating Boot-Disks was also designed during the project which can be used only for 1.44 MB Floppy Disks.
--
Setting Up the Development Environment
Shunya OS was developed using DJGPP , LD Linker and Nasm Assembler. DJGPP needs to be installed in the home directory say C:\djgpp. It has number of directories with compiler and linker in Directory <binutils>.
To work in global environment, the environment variable has to be set up in the System variables in Windows XP. Also the path to bin directory must be set in PATH variable.
Then the compiler can be called by ‘gpp’ from anywhere on the command line. Another variant of ‘djgpp’ i.e. ‘gxx’ is generally used for Windows to compile C++ programs. In case of C files , ‘gcc’ can be used.
Linker available in ‘bin ‘ directory can be called directly by ‘ld’ command.
Bochs emulator used for testing the compiled kernel binaries must be installed in root directory. It requires a bochsrc.bxrc script file which list the configuration of the x86 system we want to emulate.
A Bochs script is written with a floppy interface and ‘lgpl-elpin’ VGA-Bios which supports enhanced color modes.
SciTe Editor is used for writing all types of codes .It provides very efficient indentation and text editing features.
Partcopy is a general utility which is in the root directory
--
Boot Process
Boot Sequence
When power is applied to the computer , it triggers RESET pin on processor, which causes processor to read from memory location 0xFFFFFFF0 and executes code from that point. This address is mapped to Read-Only Memory (ROM) containing BIOS. The BIOS must poll the hardware and set up an environment capable of booting the operating system. BIOS functionality can be broken into three areas: Power On Self Test (POST), Setup and Boot.
The main function of the POST is to test and initialize the various hardware components detected by the BIOS. As part of the POST routine, hardware devices also register themselves with the BIOS as associated with or "hooked" into certain interrupt values. For instance, by convention on the Intel platform, all hard drives register with the 13h interrupt. This allows programs to invoke this software interrupt to communicate with disk drives, utilizing device driver code within the BIOS.
Many modern operating systems supply their own 32-bit device drivers once fully running, but these operating systems do make use of BIOS routines to initially load the operating system from disk.
Once POST operations are complete, the BIOS offers the user the option of entering "Setup" mode. The user may change the configuration of the BIOS, including the boot sequence here.
The last action of the BIOS is to execute the 19h interrupt, which loads the first sector of the first boot device. Since this is the location of the boot loader, execution of the 19h interrupt transfers control to the boot loader. The hard drive and other devices, such as CD-ROM drives, can register as bootable and be put on a list of bootable devices, which is prioritized by the user during the "Setup" mode.
Once the BIOS loads the first sector of the boot device into RAM, the boot loader begins execution .In the case of a hard drive, this f