Hi guys,
for the time now I tested my OS with QEMU, but now i want to test it on real hardware. I only have CDs at home wich you can only burn 1 time, so every time I will test my OS 1 CD would be wasted. Thats why I want to make a bootable USB stick which is obviously reusable. I have no clue how to make one of these USB Sticks. I cannot find any tutorial on this and I am lost now. Can someone help me pls
Bootable USB-Stick for my OS
Re: Bootable USB-Stick for my OS
Try to dd your disk image directly to your USB stick. Most BIOSes should accept it. Make sure to write it to the disk device itself, not the partirion (for example /dev/sdf and not /dev/sdf1). If you are on Windows, use a tool like Win32 Disk Imager or something like that.
The other option is to use USB -> SATA adapter on your development machine and write your image directly to HDD/SSD. Then just connect it to your target machine using SATA cable. eSATA port would be even more convenient if you have one in your target machine.
Your image size doesn't have to match your physical media size. It should just fit on it.
The other option is to use USB -> SATA adapter on your development machine and write your image directly to HDD/SSD. Then just connect it to your target machine using SATA cable. eSATA port would be even more convenient if you have one in your target machine.
Your image size doesn't have to match your physical media size. It should just fit on it.
-
- Member
- Posts: 106
- Joined: Sat Feb 08, 2020 11:11 am
- Libera.chat IRC: sunnysideup
Re: Bootable USB-Stick for my OS
Hello!
If you're using linux, dd is one of the best ways to try it out.
Suppose your OS raw binary is this : disk.img.
In the linux terminal, you can:
If you're using linux, dd is one of the best ways to try it out.
Suppose your OS raw binary is this : disk.img.
In the linux terminal, you can:
Code: Select all
sudo dd if=disk.img of=/dev/sdx (Mostly sdx, where sdx = sda or sdb or sdc or .... depending on the usb disk. You can get this using lsblk)
Re: Bootable USB-Stick for my OS
to keep my USB stick usable for something other than testing my os, i installed grub2 on it and compiled my kernel in multiboot format, and you have to add an entry in the grub.cfg file like that:
and you can test multiboot image with QEMU: qemu-system-i386 -k fr -hda hda.img -kernel "C:\hobbyos\hobbyos.bin"
the main difficulty is to return to real mode if you need to start your os in real mode because the boot in multiboot mode is done in protected mode
Code: Select all
menuentry "Hobby OS" {
multiboot /grub2/hobbyos.bin
boot
}
the main difficulty is to return to real mode if you need to start your os in real mode because the boot in multiboot mode is done in protected mode
Re: Bootable USB-Stick for my OS
Hi,
For a tutorial, see our wiki: Bootable Disk.
Cheers,
bzt
Recently there was a thread about this.HayJayDee wrote:I have no clue how to make one of these USB Sticks.
Here's an example mkimg.c on how to create an image (hybrid, works for USB sticks and CDROMs too). If you're on Windows, you can also use BenLunt's tool. To write out the generated image file to an USB stick, you can use the "dd" command, or if you prefer a windowed app, use USBImager (available on Linux, Windows, MacOSX).HayJayDee wrote:I cannot find any tutorial on this and I am lost now. Can someone help me pls
For a tutorial, see our wiki: Bootable Disk.
Cheers,
bzt