flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > How do I make a USB bootloader? |
Author |
|
revolution 10 Feb 2009, 02:22
Use a VM for rapid testing.
|
|||
10 Feb 2009, 02:22 |
|
Coddy41 10 Feb 2009, 16:38
But, I have Linux, And i like to test under real term conditions
|
|||
10 Feb 2009, 16:38 |
|
revolution 11 Feb 2009, 00:32
You don't have to test it live every time, right? Just once every few iterations should be appropriate.
|
|||
11 Feb 2009, 00:32 |
|
bitRAKE 12 Feb 2009, 05:13
It is possible to write directly to USB drive sectors:
http://shounen.ru/soft/flashnul/ (includes source code in C++, easy to convert to FASM - something like: Code: drv_name TCHAR '\\.\PhysicalDrive6',0 ; G:\ nStart = 0 pData file "floppy.img" nData = $ - pData align 16 hDevice rq 1 lpBytesReturned rq 1 invoke CreateFile,drv_name,GENERIC_READ|GENERIC_WRITE,\ FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL cmp rax,INVALID_HANDLE_VALUE je .cannot_open_drive mov [hDevice],rax invoke DeviceIoControl,[hDevice],FSCTL_ALLOW_EXTENDED_DASD_IO,\ NULL,0,NULL,0,lpBytesReturned,NULL test eax,eax ; BOOL je .no_extended invoke SetFilePointerEx,[hDevice],nStart,NULL,FILE_BEGIN test eax,eax ; BOOL je .no_seek invoke WriteFile,[hDevice],pData,nData,lpBytesReturned,NULL test eax,eax ; BOOL je .no_write invoke CloseHandle,[hDevice] retn .no_write: .no_seek: .no_extended: invoke CloseHandle,[hDevice] .no_open_drive: ; print error message retn Be careful though: some BIOS' only support floppy or hard disk emulation of USB devices. Hard disks need a partition table with an active partition (which are emulated on some USB sticks?). |
|||
12 Feb 2009, 05:13 |
|
bitRAKE 12 Feb 2009, 06:19
Under Linux I hear it's even easier to write sectors to a USB stick.
Sorry, just noticed you were not working with Windows. |
|||
12 Feb 2009, 06:19 |
|
Coddy41 12 Feb 2009, 16:17
That ok I have XP on my old desktop but I have Ubuntu on my used to be vista laptop
ha ha, the web site is in Russian, I was going to try to learn Germen but know most things I need seem to be in Russian... |
|||
12 Feb 2009, 16:17 |
|
egos 13 Feb 2009, 12:41
This program is first of all intended for testing of the USB flashes, not for editing. I like HxD for this purpose: HxD web site.
USB flush has same structure as a hard drive, including MBR with partition table. You can use same MBR and FAT16/32 partition boot loaders if they implement work with EDD service. |
|||
13 Feb 2009, 12:41 |
|
Coddy41 14 Feb 2009, 22:15
I'll just use this http://home.gna.org/bless/
|
|||
14 Feb 2009, 22:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.