👤
Home Man
Search
Today's Posts
Register

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

read sectors from disk failed with timeout

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 09-02-2011
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.
👤 Login to reply

« Previous Thread | Next Thread »
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
Read timeout rprasad Shell Programming and Scripting 8 11-10-2014 08:19 AM
[Solved] Use of prtdiag to give information of sectors,cylinders,track of each disk omkar.jadhav Shell Programming and Scripting 2 03-28-2014 03:40 AM
read sectors from disk failed with timeout wljackhero UNIX for Advanced & Expert Users 0 09-04-2011 11:55 PM
read sectors from disk failed with timeout wljackhero Linux 0 09-04-2011 11:29 PM
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
Scsi Disk Failed nikk UNIX for Advanced & Expert Users 1 11-17-2001 06:31 PM


All times are GMT -4. The time now is 06:04 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password