flat assembler
Message board for the users of flat assembler.

Index > OS Construction > hd boot order

Author
Thread Post new topic Reply to topic
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 04 May 2005, 22:52
Hello, i tried to post on alt.os.development but google has more problems everytime.

I have write a boot sector that loads a file (Os kernel) from a subdirectoire
in a fat32 partition, instead of using bios that is limited to 8GB on most computers ,i have included a ide driver wich uses lba48 ,the ports adress are hardcoded ,so if i change the disk from ide1 to ide2 it will not work, to solve this i will try all combinations in the same order that the bios uses,
but i'm not sure if all the bios use the same order , for example if master
disk on first ide controller is not present , the bios will try to boot slave disk on first controller or master disk on second controller?
exits a better way to know wich port i have to use?
note that i need a simple solution, because 400bytes for code is not very much.
Post 04 May 2005, 22:52
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 05 May 2005, 01:30
I do not think that the order really matters Wink
This order is for the user to setup in the BIOS

If your OS was loaded from a HDD then you can continue from there Wink
And you do not have to do everything in the first 512bytes; you can load a seconday stage code... and there you will have more space for your loader code.
Post 05 May 2005, 01:30
View user's profile Send private message Visit poster's website Reply with quote
PopeInnocent



Joined: 01 Jan 2004
Posts: 18
Location: USA
PopeInnocent 05 May 2005, 02:52
You might want to try drive BIOS function 42h. See http://www.ctyme.com/intr/rb-0708.htm. On the systems I have tested (5 years old and newer), this function reads hard drives larger than 132GB without any trouble.

As far as finding the IDE controller I/O port, newer computers that boot from SATA controllers can use almost any port, so hardcoded addresses wouldn't work. If you wanted to make things really complicated (yes, I know you don't, but let's just pretend), you could have your boot sector code load additional sectors from the first track (which is otherwise unused) and have a nice complicated program that queried the PCI bus or Boot BIOS Specification (http://www.phoenix.com/NR/rdonlyres/56E38DE2-3E6F-4743-835F-B4A53726ABED/0/specsbbs101.pdf).
Post 05 May 2005, 02:52
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 05 May 2005, 22:13
Anyone has understand the problem.
first: i can´t use the bios because on 2 of the 3 computers i have at home
the bios has the 8Gb limit (64bit lba service is not implemented)
second: my os don´t have his own partition ,it uses a windows fat32 partition and i don´t want to overwrite current boot sectors, my boot sector is stored in a file and its loaded by windows multiboot loader, and loading a second stage loader has more problems that loading the kernel because i don´t want to reserve fixed sectors, only files. and why would i
make a second stage boot loader if i can do all i want in one sector.
finally the boot program test the 4 ide drives using ports 1f0h 170h those ports are more standard than the bios, y have already tested and works like i want.

of course i could do like windows and put a second stage boot loader on the first partition below the 8GB limit ,but this solution don´t works if the
first partition is like ntfs not supported by my OS.
Post 05 May 2005, 22:13
View user's profile Send private message Visit poster's website Reply with quote
Scanner



Joined: 14 May 2005
Posts: 7
Scanner 14 May 2005, 11:57
Octavio, the boot order defined by the BIOS is BIOS specific. In the older days you could only boot of the Primary Master. Ignore the boot order because newer bios's support booting of network cards, flash discs, etc. You can set which drive to boot from as well. Maybe have a look at the GRUB documentation referring to the Multiboot specification.

Whatever order you implement will be up to you to define.
Post 14 May 2005, 11:57
View user's profile Send private message Yahoo Messenger Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 17 May 2005, 09:20
Scanner wrote:
Octavio, the boot order defined by the BIOS is BIOS specific.

I´m talking about the hard disk only , and have seen any computer wich boots first the slave hard disk if a master disk is present.
Since the boot sector is placed on the hard disk ,i don´t have to worry about other boot devices, for other devices i use another boot code.
I´m not sure but i think that grub uses the bios, so it has the bios limitations.
Post 17 May 2005, 09:20
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.