Write a file to "Sector 0" using C#?
Possible Duplicate:
How can i put a compiled boot sector onto a USB stick or disk?
I'm busy creating a basic boot loader, it is for software that needs to run without an OS
I also want to write a small console app that moves the compiled bootloader to my SD card.
The problem I am running into is writing that specific boot loader to Sector0 on an SD card. The SD card is slotted into my SD Card slot on my laptop.
Can I accomplish this using a C# console app ? if not, what are my options on getting that boot loader on the SD card?
Update: The bootloader is written in C, I would like the console app that transfers the boot loader to be in C#
You could use low level IO API to write a file to a specific sector. Have a look at WriteFile documentation for more info.
更简单的想法是使用引导加载程序(以及可选的分区表和/或文件系统)创建映像文件,并使用外部工具(如dd或Image Writer)将映像实际写入SD卡。
链接地址: http://www.djcxy.com/p/10812.html上一篇: 事件发生两次
下一篇: 使用C#将文件写入“扇区0”?