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
Replacing a failed disk using SVM fretagi Solaris 9 03-15-2017 06:41 PM
Read timeout rprasad Shell Programming and Scripting 8 11-10-2014 09: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 04:40 AM
read sectors from disk failed with timeout wljackhero UNIX for Advanced & Expert Users 0 09-05-2011 12:55 AM
read sectors from disk failed with timeout wljackhero Linux 0 09-05-2011 12:29 AM
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 09:09 PM.

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