Unix/Linux Go Back    


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

read sectors from disk failed with timeout

Boot Loaders


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-02-2011   -   Original Discussion by wljackhero
wljackhero's Unix or Linux Image
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:

Code:
[jack@localhost 1]$ cat boot.S
.code16
#define SETUPLEN  4
#define BOOTSEG  0x7C0
#define INITSEG  0x900

.text
a:
mov $BOOTSEG, %ax
mov %ax, %ds
mov $INITSEG, %ax
mov %ax, %es
mov $256, %cx
sub %si, %si
sub %di, %di
rep
movsw

jmp 0x9000+go-a

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

load_setup:
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

ok_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

msg:
.byte 13, 10


.org 510
.word 0xaa55

looking forward to replies.
really appreciate any suggestion.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 10:27 PM
Smartmontools and fixing Unreadable Disk Sectors justinian Filesystems, Disks and Memory 0 08-05-2009 09:57 PM
read from std i/p with timeout within a script Blue_shadow Shell Programming and Scripting 2 04-27-2009 03:48 PM
SCSI disk spare sectors rednex Filesystems, Disks and Memory 6 12-30-2007 04:31 AM
ksh read timeout ashterix Shell Programming and Scripting 2 12-09-2005 12:23 PM



All times are GMT -4. The time now is 05:19 AM.