Mkisofs usage 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.
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Mkisofs usage help

Post 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.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: Mkisofs usage help

Post by Bender »

"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Mkisofs usage help

Post 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.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Mkisofs usage help

Post 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
seuti
Member
Member
Posts: 74
Joined: Tue Aug 19, 2014 1:20 pm

Re: Mkisofs usage help

Post 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
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Mkisofs usage help

Post by StartOS »

I use GRUB version 0.95.
I think there is no grub.cfg needed
All a good OS needs to do is to run Linux inside QEMU :-)
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Mkisofs usage help

Post by iansjack »

What's in your menu.lst?
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: Mkisofs usage help

Post by KemyLand »

menu.lst should contain the following:
OSDev Wiki wrote: menuentry "OS" {
multiboot /boot/system/kernel.elf
}
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Mkisofs usage help

Post 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???
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: Mkisofs usage help

Post by KemyLand »

StartOS wrote:Error 13: Invalid or unsupported file format
Show us your linker script and/or listen to the wiki :? .
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Mkisofs usage help

Post by StartOS »

I use the linker script provided in the BareBones tutorial and the bootstarp assembly in Bare Bones with nasm
Last edited by StartOS on Tue Dec 30, 2014 1:13 am, edited 1 time in total.
All a good OS needs to do is to run Linux inside QEMU :-)
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Mkisofs usage help

Post by iansjack »

We can assume that you have created a 32-bit gcc cross-compiler which you are using for this project?
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Mkisofs usage help

Post 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.
All a good OS needs to do is to run Linux inside QEMU :-)
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: Mkisofs usage help

Post 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 [-X ! 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...
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Mkisofs usage help

Post 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.
Post Reply