------------------------------------------
BITS 16
cli
mov ax, 0x7c0
mov ds, ax
sti
;Set video mode
mov ax, 3
int 0x10
;Write "TEST" in yellow text on blue background
mov ax, 0xb800
mov es, ax
mov si, test_string
xor di, di
mov cx, 8
rep movsb
system_halt:
hlt
jmp system_halt
test_string db "T", 0xE1, "E", 0xE1, "S", 0xE1, "T", 0xE1
TIMES 0x1BE-($-$$) DB 0
;Partition table
db 0x80, 0, 0, 0, 0x0C, 0, 0, 0
dd 0
dd 3963904
TIMES 16 db 0
TIMES 16 db 0
TIMES 16 db 0
DW 0xAA55
---------------------------------------
The code works as expected in Bochs (though I treat it as a hard disk
image). I have made the assumption that USB keys are treated like
hard disks. That is, it loads the first sector of the device and
checks the boot sig, etc. I have written this directly to the USB key
using the Unix dd command, and have confirmed that it is writing it
properly by reading it back. My laptop (Dell Inspiron 6000)
definitely supports USB boot, as it has an option in the boot list for
it. I have set the USB device as the first device to attempt to boot
from. When the device is inserted and the computer rebooted, the
computer just hangs with a flashing cursor at the top left of the
screen. Is there anything else that I must do to get this to work?
Regards,
B.
> ------------------------------------------
> BITS 16
> cli
> mov ax, 0x7c0
> mov ds, ax
> sti
* CLI/STI is not required here
> ;Set video mode
> mov ax, 3
> int 0x10
* comment-out the two lines above ? (should be default anyway)
if you like to clear the screen by it set DS after this ?
> ;Write "TEST" in yellow text on blue background
> mov ax, 0xb800
> mov es, ax
> mov si, test_string
> xor di, di
> mov cx, 8
> rep movsb
should do it, except BIOS-default often use bit 7 as
blink-attribute rather than as part of a colour number.
> system_halt:
> hlt
> jmp system_halt
Are you sure that your mobile-CPU doesn't fall asleep on HALT ??
I'd replace it by an STI to have an ALT-CTRL-DEL opportunity.
> test_string db "T", 0xE1, "E", 0xE1, "S", 0xE1, "T", 0xE1
> TIMES 0x1BE-($-$$) DB 0
>
> ;Partition table
> db 0x80, 0, 0, 0, 0x0C, 0, 0, 0
> dd 0
> dd 3963904
>
> TIMES 16 db 0
>
> TIMES 16 db 0
>
> TIMES 16 db 0
>
> DW 0xAA55
>
> ---------------------------------------
> The code works as expected in Bochs (though I treat it as a hard disk
> image). I have made the assumption that USB keys are treated like
> hard disks. That is, it loads the first sector of the device and
> checks the boot sig, etc. I have written this directly to the USB key
> using the Unix dd command, and have confirmed that it is writing it
> properly by reading it back. My laptop (Dell Inspiron 6000)
> definitely supports USB boot, as it has an option in the boot list for
> it. I have set the USB device as the first device to attempt to boot
> from. When the device is inserted and the computer rebooted, the
> computer just hangs with a flashing cursor at the top left of the
> screen. Is there anything else that I must do to get this to work?
The partition info is ignored by the BIOS-boot anyway, but why a
partition-type 0Ch ? To hide it for windoze ? :)
If the emulatiion works fine then I'd see the HALT as a possible cause.
__
wolfgang
Correct. This prevents Windows 2000/XP/2003/Vista from assigning a drive letter
to this partition.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
> > The partition info is ignored by the BIOS-boot anyway, but why a
> > partition-type 0Ch ? To hide it for windoze ? :)
> Correct. This prevents Windows 2000/XP/2003/Vista from assigning a
> drive letter to this partition.
good to know, thanks
__
wolfgang
I wondered if this code would work as a floppy boot, and it does boot
from floppy into a flashing 'TEST' text as blue on brown background
with the cursor at 0'0.
Steve
On any removable media.
> * CLI/STI is not required here
I know, it is leftover from when it was used to protect a stack setup,
but I removed that code for clarity and forgot to remove the CLI/STI
> > ;Set video mode
> > mov ax, 3
> > int 0x10
>
> * comment-out the two lines above ? (should be default anyway)
> if you like to clear the screen by it set DS after this ?
>
I'm pretty sure it is generally the default, but it can't hurt to make
sure everything is in a sane state
> > ;Write "TEST" in yellow text on blue background
> > mov ax, 0xb800
> > mov es, ax
> > mov si, test_string
> > xor di, di
> > mov cx, 8
> > rep movsb
>
> should do it, except BIOS-default often use bit 7 as
> blink-attribute rather than as part of a colour number.
So it does, but Bochs doesn't seem to have this as a default.
Regards,
B.
> Make sure that you are writting to the device and not the partition.
> In windows DD, assuming the USB flash drive is the 2nd device:
>
That was the problem, I was writing to /dev/sdb1, and I should be
writing to /dev/sdb. Thanks for your help.
Regards,B.
AFAIR, that's somehow configurable.
Alex