Second Stage Booting

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Second Stage Booting

Post by Pitchu »

Thanks 2 everybody for CPUID.
Well, I again have same problem, i.e. , while my second-stage bootloader boots and loads Kernel into memory it will do following things :

1. Stores H/W information gathered and passes to kernel.
2. Stores information about Partitions and Filesystems and passes to kernel.
3. And Finally Displays some information about HW and loads kernel.

I have 2 problems:
1. How to get information about Motherboard Vendor,Video Card Model, etc.I mean the component list is long where could I find it all?

2. Where could I find a complete documentation of NASM?
thomasloven
Member
Member
Posts: 89
Joined: Tue Feb 26, 2008 10:47 am
Location: Sweden

Post by thomasloven »

User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

Thanx
i hav a query, i need 2 access BPB of the bootsector by my kernel which i can by remembering the address at which BS is loaded and then hardcoring address in instructions. Yep it is not a good way. What can i do?
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

Are you sure you mean the bootsector? The first stage bootloader?

In any case, the bootsector was loaded at 0x7c00. You can code your second stage bootloader to load anywhere. If you do not overwrite the memory at 0x7c00, then your bootsector will still be in RAM.

If you don't like that method, then your second stage bootloader should be able to save a copy of your bootsector anywhere else in memory that you want.

If you don't like that method: your bootsector is the first sector of your boot partition. Your OS MUST know which partition it booted from, in order to continue the boot. Which means it has to be looking at a copy of the partition table (of whatever type of partition table you are using). If you want the bootsector, then load up the first sector of your boot partition.
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: Second Stage Booting

Post by Ready4Dis »

Pitchu wrote:Thanks 2 everybody for CPUID.
Well, I again have same problem, i.e. , while my second-stage bootloader boots and loads Kernel into memory it will do following things :

1. Stores H/W information gathered and passes to kernel.
2. Stores information about Partitions and Filesystems and passes to kernel.
3. And Finally Displays some information about HW and loads kernel.

I have 2 problems:
1. How to get information about Motherboard Vendor,Video Card Model, etc.I mean the component list is long where could I find it all?

2. Where could I find a complete documentation of NASM?
Well, first you need to write some code to search for PCI devices, this will help determine many things installed in your system. Also, while doing a search for PCI information, you will come upon a list (or a few lists) made by other people that have almost all hardware to date entered in there with their ID's and names. You could probably go into google and type 'pci device list' and find a nice listing rather quickly.
Post Reply