Page 1 of 1

Trying to boot from USB

Posted: Tue Jan 15, 2013 2:15 pm
by zgintasz
Hi,
Recently I get an old laptop for testings. It's BIOS is AMI 1.02C. In BIOS settings it shows option to boot from "Removable Dev.", but somewhy it doesn't work and I use plop boot manager to boot from USB(I tried to boot ubuntu from usb, it booted only with plop boot manager).
I would like to try to boot my operating system, but it doesn't boots. I have tried to copy bootloader using cygwin with "dd bs=512 count=1 if=build/tmpcdcontent/boot/stage1 of=/cygdrive/h/boot/stage1 conv=notrunc", "dd bs=512 seek=1 if=build/tmpcdcontent/boot/stage2 of=/cygdrive/h/boot/stage2 conv=notrunc" and copied kernel.bin file manually. When I select USB from plop boot manager, I get "Reboot or Select proper Boot device", after clicking enter I get isolinux error.
USB is 124MB FAT. Sorry, I'm new in os development and I would like to learn, but my English isn't very well to understand various tutorials.
So any ideas how can I boot it :roll:?
Thanks, have a nice day.
P.S. os is using GRUB bootloader.

Re: Trying to boot from USB

Posted: Tue Jan 15, 2013 3:55 pm
by summersong
Maybe better to buy USB FDD drive?
Much better write something usefull (using emulators for testing), before you run code at real hardware.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 3:31 am
by Combuster
isolinux (...) GRUB
Copying files never installs a bootloader. Otherwise, wouldn't your computer already have used GRUB for booting the moment after you unzipped it?

Also "isolinux" consists of two words: ISO9660 and Linux. Look them up if you don't know them, but it's pretty obvious that it got from somewhere and was designed to go somewhere - your OS is not part of that.


After that, go read the GRUB installation instructions.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 3:42 am
by egos
zgintasz, first of all I would say that USB booting has some bugs and disadvantageous things on different hardware.

Despite your detailed description of the problem I could not understand many things. I had not understood what your dd commands do. I had not understood what boot order is used in your media. Too many names (PLOP, SYSLINUX, GRUB), but not enough details!

If "your OS is using GRUB" does this mean that your kernel is Multiboot compliant? If so you should use GRUB (or other Multiboot compliant boot loader) first of all. If it was set up correctly but still would not work you should try other additional or alternative boot loaders. So, we need details.

summersong, are you Russian?

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 4:46 am
by zgintasz
Thanks for some answers.
If I would buy external FDD drive which connects to USB, will it be able to boot from it without any other drivers, like a normal(not external) fdd? I would like to make it on USB, because I don't have much money to spend on this little project :roll:. dd commands should copy bootloader files to USB. BIOS settings boot device priority is CD/DVD, Removable Dev. and then Hard Drive(in hard drive there is ubuntu, but it doesn't matter, because my os doesn't use hard drive). And yes, os is multiboot compliant, I've used grub bootloader to test os on emulator, it was on floppy disk.
So how can I copy grub bootloader files stage1 and stage2 to make USB bootable and then I would configure it? Because now it seems it doesn't even recognise, that USB is bootable.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 5:46 am
by bluemoon
I doubt if modern machine's BIOS has enough test with physical floppy drive under USB cable - it's just a monster setup.
I would try doing CD emulation for floppy first, and limit the testing inside VM emulator instead of spending any money on the "floppy technology".

So, Is there any reason you avoiding CD or HDD for your kernel?
If you support booting off HDD, you can even boot from usb stick which is great convenience.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 6:35 am
by zgintasz
Do you mean write a bootloader to HDD, which would load kernel from USB? Really nice idea, but I'm not sure how can I do that, because I'm really newbie. It would be nice if someone give me a tutorial link.
By the way, I didn't understood well what do you mean by saying "CD emulation for floppy".

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 6:42 am
by Yoda
What do you have at the moment and what is your purpose?
Preparing bootable media depends on what do you want to boot and on OS you are using on your desktop.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 6:54 am
by zgintasz
I've made a little kernel and my purpose is to boot my operating system on that laptop(in other words to prepare laptop for being my os testbed). Laptop has Ubuntu on HDD right now, but I can format the HDD whenever, because I don't use it. My desktop computer which I use for development and other things is in windows 7 64bit.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 7:12 am
by Yoda
Is your kernel Multiboot compliant?
How do you know that your kernel is functional?
You don't need to spoil you HDD by experiments with booting. Did you try to set up virtual HDD image and boot from it in Bochs?

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 7:23 am
by bluemoon
You seems have little idea of boot process. I suggest you study the various boot mechanism, and instead of provide method for you to follow, I shall point you to the wiki Main_Page.

PS. I mean uses the BIOS's "Boot from USB" option and treat the usb stick as harddisk (with partitions, etc).

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 8:00 am
by egos
zgintasz wrote:dd commands should copy bootloader files to USB.
...
So how can I copy grub bootloader files stage1 and stage2 to make USB bootable and then I would configure it? Because now it seems it doesn't even recognise, that USB is bootable.
Installing GRUB by hand is too complex way (as you could see here :wink:). "dd bs=512 count=1..." is destructive way. Use GRUB installer or more safe tools/boot loaders. For example, give me your stage2 and I will build sys file for Yoda's OS Boot Tools.
I've made a little kernel and my purpose is to boot my operating system on that laptop(in other words to prepare laptop for being my os testbed). Laptop has Ubuntu on HDD right now, but I can format the HDD whenever, because I don't use it.
You can use only one small partition for your OS as I have done.

Re: Trying to boot from USB

Posted: Wed Jan 16, 2013 11:57 am
by summersong
Yes, I'm from Russian.