Page 1 of 2
Mkisofs usage help
Posted: Wed Dec 24, 2014 8:33 am
by StartOS
I want to get started with os development, have created all the files from
Bare Bones tutorial, everything compiles and links, but i can't create an disk image.
I have read the OSDev wiki article about
mkisofs, but i still can't get it.
I am using Windows, with CDRTools installed and added to PATH.
Running the mkisofs command works.
My project structure looks like this:
>OS
--->img
------>boot
--------->grub
------------>stage2_eltorito
------------>menu.lst
------>system
--------->kernel.elf
--->kernel.c
--->boot.asm
---> builder.bat (my own script that builds the project, haven't learnt makefile yet)
--->all object files...
In the builder.bat file I added
mkisofs -b iso/boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o bootcd.iso iso , but it says:
Setting input charset to 'UTF-8' from local
mkisofs: Uh oh, i cant find the boot image iso/boot/stage2_eltorito inside the target tree
Plz explain me how to use this command.
Re: Mkisofs usage help
Posted: Wed Dec 24, 2014 8:42 am
by Bender
Re: Mkisofs usage help
Posted: Wed Dec 24, 2014 11:06 am
by xenos
StartOS wrote:Code: Select all
--->img
------>boot
--------->grub
------------>stage2_eltorito
Code: Select all
mkisofs -b iso/boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o bootcd.iso iso
Code: Select all
mkisofs: Uh oh, i cant find the boot image iso/boot/stage2_eltorito inside the target tree
Use the correct path.
Re: Mkisofs usage help
Posted: Fri Dec 26, 2014 6:51 am
by StartOS
Thanks for the help.
The iso mounts correctly in VirtualBox and GRUB loads, however I still get a problem.
GRUB loads an command line instead of my os.
Whats wrong???
The menu.lst file looks like this:
default 0
title StartOS
kernel /boot/kernel.elf
Re: Mkisofs usage help
Posted: Fri Dec 26, 2014 8:19 am
by seuti
StartOS wrote:Thanks for the help.
The iso mounts correctly in VirtualBox and GRUB loads, however I still get a problem.
GRUB loads an command line instead of my os.
Whats wrong???
The menu.lst file looks like this:
default 0
title StartOS
kernel /boot/kernel.elf
I think it does that if it can't find your grub.cfg
Re: Mkisofs usage help
Posted: Fri Dec 26, 2014 11:44 am
by StartOS
I use GRUB version 0.95.
I think there is no grub.cfg needed
Re: Mkisofs usage help
Posted: Fri Dec 26, 2014 12:44 pm
by iansjack
What's in your menu.lst?
Re: Mkisofs usage help
Posted: Fri Dec 26, 2014 7:09 pm
by KemyLand
menu.lst should contain the following:
OSDev Wiki wrote:
menuentry "OS" {
multiboot /boot/system/kernel.elf
}
Re: Mkisofs usage help
Posted: Sun Dec 28, 2014 10:22 am
by StartOS
Got it right by:
Placing kernel.elf in /boot
Changing menu.lst
Using other ARGV's with mkisofs
But now GRUB says:
Error 13: Invalid or unsupported file format
What??? GRUB does not support multiboot ELF files???
Re: Mkisofs usage help
Posted: Sun Dec 28, 2014 10:30 am
by KemyLand
StartOS wrote:Error 13: Invalid or unsupported file format
Show us your linker script and/or
listen to the wiki .
Re: Mkisofs usage help
Posted: Mon Dec 29, 2014 9:53 am
by StartOS
I use the linker script provided in the BareBones tutorial and the bootstarp assembly in
Bare Bones with nasm
Re: Mkisofs usage help
Posted: Mon Dec 29, 2014 10:10 am
by iansjack
We can assume that you have created a 32-bit gcc cross-compiler which you are using for this project?
Re: Mkisofs usage help
Posted: Tue Dec 30, 2014 10:46 am
by StartOS
Nope I don't have an cross compiler.
I thought it would be possible with standard MinGW.
I also use my computer to develop system dependent software and don't want to install another compiler for os development.
What extra ARGVs should I add to make it work.
I use the commands from BareBones, but with gcc instaed of i686-elf-gcc.
Re: Mkisofs usage help
Posted: Tue Dec 30, 2014 11:00 am
by KemyLand
StartOS wrote:Nope I don't have an cross compiler.
I thought it would be possible with standard MinGW.
I also use my computer to develop system dependent software and don't want to install another compiler for os development.
What extra ARGVs should I add to make it work.
I use the commands from BareBones, but with gcc instaed of i686-elf-gcc.
Bad, bad
! You
must make a cross-compiler. You have been previously warned (in BareBones) that this could create problems, and it did! Are you developing in a 32-bit machine, or a 64-bit machine? If you're using 64-bits, that's part of the issue. Also, MinGW sounds me like you're generating PEs instead of ELFs with your distributed compiler. GRUB will never recognize this. No flags will fix this, you need a cross-compiler targeted for i686-elf! A simple test? Write a Hello World and compile it with your standard gcc. Then try to run it in full Windows. If it works, you're the wrong way...
Re: Mkisofs usage help
Posted: Tue Dec 30, 2014 11:30 am
by iansjack
StartOS wrote:Nope I don't have an cross compiler.
I thought it would be possible with standard MinGW.
Well, the good news is that you have now determined what the problem is. If you are going to follow a tutorial you ought to (at least to start with) follow the tutorial.