Custom BootSector Booting Into Stage2 [Problems]

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.
kubeos
Member
Member
Posts: 138
Joined: Tue Jan 30, 2007 2:31 pm
Location: Kamloops BC, CANADA
Contact:

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by kubeos »

I don't believe this. After all that help in your other thread about MBR's and partition's, it appears you don't even have a filesystem. You told me your boot sector used ext2. You aren't even taking into consideration the relative offset of the partition for your "second stage".

Instead of worrying about a usb drive, worry about getting something to boot from a floppy first, (use BOCHS, it's your friend)
XeonX369
Member
Member
Posts: 29
Joined: Mon Sep 28, 2009 1:12 pm

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by XeonX369 »

neon, I apologize for what is about to come, and I realize that you probably laugh at my Idiocy, and I also realize that my Idiocy grows tiring...

but I have tried all that you have stated, I even set my bootloader to be read into 0x500 (as is your preference) it still doesn't function.
kubeos wrote:I don't believe this. After all that help in your other thread about MBR's and partition's, it appears you don't even have a filesystem. You told me your boot sector used ext2. You aren't even taking into consideration the relative offset of the partition for your "second stage".

Instead of worrying about a usb drive, worry about getting something to boot from a floppy first, (use BOCHS, it's your friend)
Kubeos, I am sorry. I do indeed have my USB drive formatted to use ext2, but I was stupid enough not to consider that I should code the bootsector to use ext2.

To all, I am direly sorry for all grief/ignorance/stupidity that I may have caused/displayed during this conversation. I am indeed a novice at OSDev, and rightly, should not even be here. My only relative programming experience has been with small bouts of Assembly, and sufficience C/C++.

Thanks to all who contributed and have drove to point home to me that I should rather not be doing this now. I think that I will give GRUB a try for this purpose. After I have taken a long break.

Sorry...Sorry...Sorry...Sorry......
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by neon »

Hello,

There is no need to apologize - you have not done anything wrong. If you are a novice, this is just the place for you - you cant give up that easily ;)

If you want to get into a bootloader, just practice with it and learn real mode assembly language. Learn how to parse ext2, load, and run your "second stage bootloader". If this might be too hard right now, just use an existing one or follow a tutorial to help you set up a working framework that you can build off of.

Whatever you choose, good luck with your endeavors :)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Masterkiller
Member
Member
Posts: 153
Joined: Sat May 05, 2007 6:20 pm

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by Masterkiller »

I didn't see any post that you have debugged your code. You probably just test it and if it is not working, you seek us for solution. Soon you will stuck in another place and no one will help. Read the OSDev wiki page about debugging and try to look where are YOU mistake and fix the code by your own.
ALCA OS: Project temporarity suspended!
Current state: real-mode kernel-FS reader...
scottmidgley
Posts: 1
Joined: Fri May 20, 2011 3:03 pm

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by scottmidgley »

I don't know for certain, but as I understand it you cannot rely on the contents of dl for the boot drive number when you boot from a USB stick.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Custom BootSector Booting Into Stage2 [Problems]

Post by Combuster »

Necromancy alert...
you cannot rely on the contents of dl for the boot drive number
If that happens, the BIOS is broken by definition.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply