Results 1 to 7 of 7
I have seen many tutorials on how to do this in windows using downloadable programs, but I have no idea how to do this in Ubuntu. I assume it is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-04-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 2
Writing a bootsector.bin file to a USB sector 1
I have seen many tutorials on how to do this in windows using downloadable programs, but I have no idea how to do this in Ubuntu. I assume it is the same in ever other variant of Linux but I just wanted to note that I am using Ubuntu 10.04LTS.
My main purpose for this is to write the 8086emu Micro-OS-Loader (Cylinder 0, head 0, Sector 1) and Micro-OS-Kernel (Cylinder 0, head 0, Sector 2) to a USB flash disk to test to see if it boots up or not. I could do this in Windows, but I want to know how to do this in Linux so I am not dependent on using Windows in order to write my Operating system's data on my USB.
If you need additional information on the system I am using, just ask and I will edit the first post.
Thank you for your help.
- 11-05-2011 #2
The flash disk should show up as a /dev device, probably /dev/sdb or whatever letter is next after what's already there before you connect it. You'd use dd to write the sectors. Look at "man dd" and see the "if", "of", "bs", "count", "seek", and "skip" options. You sound clueful enough to work it out from there.
- 11-05-2011 #3Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 394
where "/dev/asX" is the correct device for your USB device.Code:dd bs=512 count=1 if=YOURSOURCEFILENAMEGOSHERE of=/dev/sdX
- 11-05-2011 #4
- 11-05-2011 #5Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 394
Yes, the count would be "2", if you "sector" really was "block" or that the loader is 1024 bytes long.
- 11-05-2011 #6
The OP specifically says he needs two sectors, 1 and 2.
- 11-11-2011 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,141
Whether count=1 or count=2 depends upon whether or not the input data is in one file or two. If one file, then this should work
if two files, then this should work:Code:dd bs=512 count=2 if=filename of=/dev/sdX
Code:dd bs=512 count=1 if=filename1 of=/dev/sdX dd bs=512 count=1 if=filename2 of=/dev/sdX seek=1
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote

