Bootloader help

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
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Bootloader help

Post by feare56 »

I can't figure out what is wrong. Every time I try to load a bootloader I always get an error saying "can't find stage2" or something along those lines. I am using magiciso to make the bootable iso file. Do I need a new program to make my bootable iso or am I doing something wrong. Right now I open magiciso and point the first stage to boot by the load boot image button and for loading the kernel I had no problem doing it that way but I always have problems with bootloaders.
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: Bootloader help

Post by Combuster »

I'm trying to stack a lot of random items but it always topples over. Help! What am I doing wrong?


Goal? Plan? Execution? Results? You only gave us one of the four essentials. (Hint: including "help" in the topic title gives a free 90% accurate prediction the poster didn't read/follow the forum rules)
"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 ]
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: Bootloader help

Post by feare56 »

Well the problem is that with any bootloader I try, i use the method stated above and it works fine for just a kernel well mine for now. I am running the iso on virtualbox, and there is no goal or plan yet until i find out if it is my program i am using, magiciso, or if it is a different option than what i said before
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Bootloader help

Post by Brendan »

Hi,
feare56 wrote:Well the problem is that with any bootloader I try, i use the method stated above and it works fine for just a kernel well mine for now. I am running the iso on virtualbox, and there is no goal or plan yet until i find out if it is my program i am using, magiciso, or if it is a different option than what i said before
I've never used "magiciso", but I'd assume it expects a bootable disk image and sets up "hard disk emulation El Torito" or "floppy disk emulation El Torito". A bootable disk image is not a boot loader, a kernel or a second stage.

It's also probably not a good idea - "floppy/hard disk emulation El Torito" is inefficient and messy, and only really exists for old OSs (e.g. DOS). Newer OSs should use "no emulation El Torito", where your boot loader uses "int 0x13 extensions" to read any (2048-byte) sectors from the CD that you want (which typically means implementing a boot loader that works with the ISO9660 file system, where things like the kernel are stored on the CD as a normal file).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader help

Post by egos »

I think TS uses his kernel as boot loader image in "No emulation" mode. If so then probably kernel is placed and starts at 7C0h:0. I have advised to TS to use boot loaders from OS Boot Tools. In this case TS should consider its Boot Spec.

feare56, did you try to use these boot loaders?
If you have seen bad English in my words, tell me what's wrong, please.
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: Bootloader help

Post by feare56 »

Yea i have used those bootloaders but with magiciso i cant use it. What tools would be good for making a working bootable iso
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader help

Post by egos »

MagicISO or any other suitable tools.

Read OS Boot Tools description and Boot Spec. Yoda's kernel image has very low base so you can use something like "copy /b prefix.bin+kernel.bin kernel.sys" to make OS Boot Tools compatible kernel image if you want to keep your original base.
If you have seen bad English in my words, tell me what's wrong, please.
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: Bootloader help

Post by feare56 »

Ok but what other iso makers are good
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Bootloader help

Post by Brendan »

Hi,
feare56 wrote:Ok but what other iso makers are good
If you know an actual programmer, you could probably give them $5 to write a utility for you. It's not hard.

For example, last time I did it I just hacked together NASM macros to generate a bootable ISO9660 (I was too lazy to use an actual programming language, like C or Python or BASIC or anything else). It probably took me a day to read the specs (for ISO9660 and El Torito) and another day to write and test everything.

[EDIT] Ironically, this "hacked together NASM macros" thing is still online - see this web page for an example of how easy it can be.
[/EDIT]


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader help

Post by egos »

During some time I used FASM macros and directives to generate ISO image. Now I use cdimage (oscdimg) and mkisofs.
If you have seen bad English in my words, tell me what's wrong, please.
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

Re: Bootloader help

Post by feare56 »

Ok thank you brendan
Post Reply