OSDev.org

The Place to Start for Operating System Developers
It is currently Sat May 18, 2024 11:41 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Grub no longer works to make .iso images
PostPosted: Wed May 15, 2024 7:30 pm 
Offline

Joined: Sat Dec 31, 2022 10:59 am
Posts: 20
So far in my OS dev journey, I've been using GRUB with multiboot (as used in the Bare Bones tutorial). During VM testing, I just bypass GRUB and give Qemu the raw image, since it has multiboot capabilities. However, every now and again I'll use the .iso file GRUB produces on a USB drive to test on real hardware.

When I went to try the .iso on my real hardware, it just sent me to the GRUB shell (from the USB drive, not from the HDD install), and I couldn't boot into my image.

When I tried to boot into the .iso in Qemu, instead of just not booting, it produced an extremely corrupted VGA-text output, and seemed to be jumping in an infinite loop from GDB's perspective.

Image

Again, I'm just using the commands provided by the Bare Bones tutorial right now, and they've worked up until recently (code is available in the Github repo in my signature). Has anyone had troubles with GRUB like this before, producing corrupted / unbootable .iso images?

For quick reference, these are the commands I run and the output I receive:

Code:
cp ./output/os.bin ./utils/grub/boot/os.bin
grub-mkrescue -o ./output/os.iso ./utils/grub


Code:
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:./output/os.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  115g free
Added to ISO image: directory '/'='/tmp/grub.dDokt4'
xorriso : UPDATE :     294 files added in 1 seconds
Added to ISO image: directory '/'='/root/nox/utils/grub'
xorriso : UPDATE :     298 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
ISO image produced: 2497 sectors
Written to medium : 2497 sectors at LBA 0
Writing to 'stdio:./output/os.iso' completed successfully.


_________________
Nox OS: https://github.com/TylerSelden/nox


Top
 Profile  
 
 Post subject: Re: Grub no longer works to make .iso images
PostPosted: Thu May 16, 2024 6:26 am 
Offline

Joined: Sat Dec 31, 2022 10:59 am
Posts: 20
After many hours of debugging, I finally realized that I had made a very silly mistake. I was going to remove this post, but I decided to keep it in case somebody in the future comes across this issue.

The command I normally use to run my OS (the .bin, not the .iso) was:

Code:
qemu-system-i386 -kernel ./output/os.bin -vnc :0


When I wanted to test the .iso, I just swapped .bin for .iso in the previous command, which caused a horrible failure within Qemu. The issue was that I had kept the "-kernel" directive, which ultimately made Qemu treat the .iso image differently than it should've. The correct command to test the .iso is:

Code:
qemu-system-i386 ./output/os.iso -vnc :0


Without the "-kernel" flag, and it all runs as it should.

_________________
Nox OS: https://github.com/TylerSelden/nox


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 20 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