Creating and writing to reserved sectors
-
- Posts: 3
- Joined: Wed Mar 30, 2016 6:16 pm
Creating and writing to reserved sectors
My operating system is currently just a bootloader (I've spent more time researching and theorizing than actual programming). One thing on my wishlist is a filesystem-independent bootloader.
I am aware that GRUB accomplishes this by keeping a "Stage 1.5" in the reserved area of a disk, but I wonder how it is possible to format a disk (a FAT12 floppy disk, for example) with reserved sectors in which I can place files into.
Does anybody know of a program (or system utility built into some OS I'm not aware of) that can format disks with certain filesystems and with reserved sectors?
I am aware that GRUB accomplishes this by keeping a "Stage 1.5" in the reserved area of a disk, but I wonder how it is possible to format a disk (a FAT12 floppy disk, for example) with reserved sectors in which I can place files into.
Does anybody know of a program (or system utility built into some OS I'm not aware of) that can format disks with certain filesystems and with reserved sectors?
Re: Creating and writing to reserved sectors
Grub uses reserved sectors on a partitioned disk. A FAT12 floppy isn't really large enough to include reserved sectors as well as the file system.
"God! Not Unix" - Richard Stallman
Website: venom Dev
OS project: venom OS
Hexadecimal Editor: hexed
Website: venom Dev
OS project: venom OS
Hexadecimal Editor: hexed
Re: Creating and writing to reserved sectors
Those are hidden sectors. You can reserve as many sectors as you want on any FAT file system (as long as you leave some of the available sectorsb.zaar wrote:Grub uses reserved sectors on a partitioned disk. A FAT12 floppy isn't really large enough to include reserved sectors as well as the file system.
available for data of course).
-
- Posts: 3
- Joined: Wed Mar 30, 2016 6:16 pm
Re: Creating and writing to reserved sectors
Yes, but how does one accomplish this? I know how GRUB does it - I'm just stumped figuring out how to do it myself.
Re: Creating and writing to reserved sectors
collisiondetection wrote:Yes, but how does one accomplish this? I know how GRUB does it - I'm just stumped figuring out how to do it myself.
Read about FAT format and just write your data accordingly. To write a sector you have BIOS functions. Just use them. You already have a bootloader, then the rest is relatively simple. Or you can write required bytes as a file under your preferred OS and next to copy the file to the beginning of a disk. Under Linux it is the dd program that can help you. Under WindowsXP it is the HxD program. May be there are other programs. Just google for them.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: Creating and writing to reserved sectors
The Windows version of DD works on all versions up to and including Windows 7.embryo2 wrote:Under Linux it is the dd program that can help you.
They are obviously two totally different programs (HxD is not a replacement for DD), however HxD is an excellent disk editor andembryo2 wrote:Under WindowsXP it is the HxD program.
works on all versions up to and including Windows 7. Both programs probably also work on Windows 10, however I can not personally verify that.
Re: Creating and writing to reserved sectors
I can confirm that HxD works flawlessly on Windows 10mikegonta wrote:The Windows version of DD works on all versions up to and including Windows 7.embryo2 wrote:Under Linux it is the dd program that can help you.They are obviously two totally different programs (HxD is not a replacement for DD), however HxD is an excellent disk editor andembryo2 wrote:Under WindowsXP it is the HxD program.
works on all versions up to and including Windows 7. Both programs probably also work on Windows 10, however I can not personally verify that.
Re: Creating and writing to reserved sectors
How about DD for Windows on Win10?alexander wrote:I can confirm that HxD works flawlessly on Windows 10mikegonta wrote:The Windows version of DD works on all versions up to and including Windows 7.embryo2 wrote:Under Linux it is the dd program that can help you.They are obviously two totally different programs (HxD is not a replacement for DD), however HxD is an excellent disk editor andembryo2 wrote:Under WindowsXP it is the HxD program.
works on all versions up to and including Windows 7. Both programs probably also work on Windows 10, however I can not personally verify that.
Re: Creating and writing to reserved sectors
I'll see if I can test that for you.mikegonta wrote: How about DD for Windows on Win10?
Edit:I assume you are talking about: http://www.chrysocome.net/dd and not https://sourceforge.net/projects/windd/