Boot Loaders

Discuss GRUB, BURG, UEFI, GPT, Mac EFI, GRUB2 and other topics about boot loaders.

read sectors from disk failed with timeout

👤 Login to reply

Old 09-02-2011
wljackhero wljackhero is offline
Registered User
Join Date: Dec 2010
Last Activity: 26 December 2011, 3:48 AM EST
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on
but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem?
my code would be like this:
[jack@localhost 1]$ cat boot.S
#define SETUPLEN  4
#define BOOTSEG  0x7C0
#define INITSEG  0x900

mov $BOOTSEG, %ax
mov %ax, %ds
mov $INITSEG, %ax
mov %ax, %es
mov $256, %cx
sub %si, %si
sub %di, %di

jmp 0x9000+go-a

mov %cs, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %ss
mov $0xFF00, %sp

mov $0x0000, %dx
mov $0x0002, %cx
mov $0x0200, %bx
mov $0x0200+SETUPLEN, %ax
int $0x13                           //timeout happens here
jnc ok_load_setup
mov $0x0000,%dx
mov $0x0000,%ax
int $0x13
jmp load_setup

mov $0x00, %dl
mov $0x0800, %ax
int $0x13
mov $0x00, %ch
mov %cx, %cs 
mov $INITSEG, %ax
mov %ax, %es

mov $0x03, %ah
xor %bh, %bh
int $0x10

mov $24, %cx
mov $0x0007, %bx
mov msg, %bp
mov $0x1301, %ax
int $0x10

.byte 13, 10

.org 510
.word 0xaa55

looking forward to replies.
really appreciate any suggestion.
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk) shen747 Linux 23 01-28-2011 09:27 PM
Smartmontools and fixing Unreadable Disk Sectors justinian Filesystems, Disks and Memory 0 08-05-2009 08:57 PM
read from std i/p with timeout within a script Blue_shadow Shell Programming and Scripting 2 04-27-2009 02:48 PM
SCSI disk spare sectors rednex Filesystems, Disks and Memory 6 12-30-2007 03:31 AM
ksh read timeout ashterix Shell Programming and Scripting 2 12-09-2005 11:23 AM

All times are GMT -4. The time now is 08:54 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?