How to make an ISO for my OS? (using custom bootloader)

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
QuerkyBren
Posts: 1
Joined: Fri Sep 29, 2017 3:53 am

How to make an ISO for my OS? (using custom bootloader)

Post by QuerkyBren »

Hi! I have been tearing my hair out trying to put my operating system on an ISO file.
Currently my makefile creates two files. a boot.bin file (which contains my bootloader) and a kernel.bin file (which contains my kernel).
The two files are combined into a single .bin using the cat command.
How will i create an ISO file from these two?
The operating system i use is Linux Mint 18.2
I will send a link containing my operating system.
Attachments
Komputilo_OS.tar.gz
Here it is
(12.92 KiB) Downloaded 61 times
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: How to make an ISO for my OS? (using custom bootloader)

Post by xenos »

This should help:
El-Torito
Mkisofs
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
MichaelPetch
Member
Member
Posts: 799
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: How to make an ISO for my OS? (using custom bootloader)

Post by MichaelPetch »

You can use genisoimg. I have a Stackoverflow Answer that will probably help you out with usage. The answer there was someone trying to get thir custom bootloader onto an ISO image.
User avatar
FelixBoop
Posts: 13
Joined: Thu Apr 24, 2014 1:35 pm

Re: How to make an ISO for my OS? (using custom bootloader)

Post by FelixBoop »

if you use mkisofs, you'll want to look at the "-no-emul-boot", "-boot-info-table", "-boot-load-size", and "-b" options. You'll also want to leave some space in your boot loader for the Boot Info Table. (This took me forever to realize, so here's an example:)

Code: Select all

jmp 0000:start
times 8-($-$$) db 0 ;this space is reserved for a quick set up and a jump instruction.
;this space reserved for boot info table
bit_PrimaryVolumeDescriptor	resd 1
bit_BootFileLocation			 resd 1
bit_BootFileLength				resd 1
bit_Checksum						resd 1
bit_Reserved						resb 40
start:
	;do something here
mkisofs will automagically fill it in for you if you tell it to. If you don't leave space, though, your code will get overwritten and will most likely crash.

You can set it up to tell the BIOS emulate a floppy drive, like in the case of an older system (I think this means that it will only be emulated with int 13h. It still acts like an ATAPI drive if you go directly, I think).

Or, you can tell the BIOS to not emulate the floppy system at all. This is probably what you want for a modern OS.

Good luck!
SAUCE CD IV - The most schwaaay OS.
Post Reply