Trying to boot from USB

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
zgintasz
Posts: 18
Joined: Sat Nov 03, 2012 11:14 am

Trying to boot from USB

Post 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.
User avatar
summersong
Member
Member
Posts: 32
Joined: Sat Mar 26, 2011 5:26 am
Location: Moscow

Re: Trying to boot from USB

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Trying to boot from USB

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Trying to boot from USB

Post 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?
If you have seen bad English in my words, tell me what's wrong, please.
zgintasz
Posts: 18
Joined: Sat Nov 03, 2012 11:14 am

Re: Trying to boot from USB

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Trying to boot from USB

Post 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.
zgintasz
Posts: 18
Joined: Sat Nov 03, 2012 11:14 am

Re: Trying to boot from USB

Post 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".
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: Trying to boot from USB

Post 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.
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
zgintasz
Posts: 18
Joined: Sat Nov 03, 2012 11:14 am

Re: Trying to boot from USB

Post 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.
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: Trying to boot from USB

Post 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?
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Trying to boot from USB

Post 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).
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Trying to boot from USB

Post 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.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
summersong
Member
Member
Posts: 32
Joined: Sat Mar 26, 2011 5:26 am
Location: Moscow

Re: Trying to boot from USB

Post by summersong »

Yes, I'm from Russian.
Post Reply