OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:48 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Bootloader not loading. WTH.
PostPosted: Sun Dec 17, 2017 7:25 am 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
So I created a two stage bootloader, with no errors in compiling and I make a FAT12 image and tryied to boot it in bochs, without success. (NO FUC*ING BOOTABLE DEVICE ERROR) So when I search for a helloworld bootloader I copy the code, compile and works!

I don't know what I'm doing wrong! When I copy 100% of a tutorial code works, when I try my own I get errors like these '-'.

So this is not a help asking mesage, it's just a I-DON'T-KNOW page. But if u want help just reply.

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Sun Dec 17, 2017 8:12 am 
Offline
User avatar

Joined: Sun Dec 10, 2017 11:15 am
Posts: 6
Could you please post your code ? Sounds like a MBR signature issue, did you properly add the 0xAA55 signature at the end of the 512-byte block ?

_________________
My C++ OS Project : https://github.com/Stellaris-code/LudOS
FAT read support, Tar, VESA, AHCI, PIO IDE, along with a basic shell !


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Sun Dec 17, 2017 12:52 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
I don't know how to use MBR flags ;-;

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Sun Dec 17, 2017 12:56 pm 
Offline
User avatar

Joined: Sun Dec 10, 2017 11:15 am
Posts: 6
Check this out :
http://wiki.osdev.org/MBR_(x86)
http://wiki.osdev.org/Boot_Sequence

_________________
My C++ OS Project : https://github.com/Stellaris-code/LudOS
FAT read support, Tar, VESA, AHCI, PIO IDE, along with a basic shell !


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Mon Dec 18, 2017 11:30 am 
Offline
Member
Member
User avatar

Joined: Sun Jan 13, 2013 6:24 pm
Posts: 90
Location: Grande Prairie AB
I think you might be missing boot signature 0x55 0xAA at the end of sector 0


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Mon Dec 18, 2017 3:45 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
I'll reiterate what others have suggested, without code it is very hard to tell you what is wrong. If you have a simple bootloader at this time there likely isn't much to it and could probably be published inside the question. If it is larger then putting it on a service like Github and providing a link would be useful. If you don't wish to do that, you could tell us what tutorial you actually used (a link) and the type of change(s) that made it unable to work in Bochs etc.


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Tue Dec 19, 2017 6:48 am 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
I think I discovered, the binary file have more than 512 Kb, actually 532 Kb this is a problem right?

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Tue Dec 19, 2017 7:48 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 20, 2011 2:01 pm
Posts: 110
AwfulMint wrote:
I think I discovered, the binary file have more than 512 Kb, actually 532 Kb this is a problem right?

Yep.
Are you building as flat binary? This sounds like you've got a static library linked.
At the end of your asm, you want
Code:
TIMES (510-$) db 0
db 0x55
db 0xAA

in nasm. I don't know the equivalent in gas, but it exists.

_________________
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS


Top
 Profile  
 
 Post subject: Re: Bootloader not loading. WTH.
PostPosted: Tue Dec 19, 2017 10:59 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
I doubt you mean Kb (maybe just bytes). Not sure why you just don't show us the code/commands you use to run it. I hope you aren't linking multiple files together with _LD_ and ignoring linker warnings. That won't work without a specially constructed linker script.

A size of 532b is not necessarily bad if you combined a first stage and second stage bootloader together after the fact, but again without showing us what you are doing, you make us just guess.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: SemrushBot [Bot] and 64 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group