Page 1 of 1

int13_diskette: unsupported AH=80

Posted: Sun Nov 29, 2009 2:47 pm
by jh302
Hello everyone.
I'm trying to make a 2 stage bootloader. I'm using gas and bochs.
The code is supposed to read sectors of the floppy (image), to load it to memory
The floppy image is created with bximage, and is written to over a loopback device.
I hope that someone can help me, I've been using a lot of time...

Code: Select all

.code16
.section .text
.globl _start
_start:
mov $0x7c0,%ax
mov %ax,%ds
mov $0,%dl
mov $0,%ah
int $0x13
jc _start
read:	
mov $2,%ah
mov $18,%al
mov $0,%ch
mov $2,%dh
mov $1,%cl
mov $0x8000,%ax
mov %ax,%es
xor %bx,%bx
int $0x13
jc read
jmp succes
jmp idle
succes:	
  mov $0xb800, %ax
  mov %ax, %ds
  movb $'O', 0
  movb $0x1e, 1
  movb $'K', 2
  movb $0x1e, 3
idle:
  jmp idle 

Re: int13_diskette: unsupported AH=80

Posted: Sun Nov 29, 2009 2:59 pm
by f2
Check out this snippet:

Code: Select all

mov $2,%ah
mov $18,%al
mov $0,%ch
mov $2,%dh
mov $1,%cl
mov $0x8000,%ax
mov %ax,%es
xor %bx,%bx
int $0x13
At the beginning, you put AH = 02h, but after you put AX = 8000h. So, AH = 80h. Do you see your mistake?

in the future, I suggest you re-read your code before posting unnecessarily.

Re: int13_diskette: unsupported AH=80

Posted: Sun Nov 29, 2009 3:30 pm
by Combuster
Tommy wrote:before posting unnecessarily.
Well, sometimes you need a second pair of eyes to see the (obvious?) solution.

What would help to fix these problems, is to use a debugger. The int is the system call, if you check directly before that what values you are actually passing, you can often locate the problem yourself. Debugging with bochs requires some practice (and time), but it really pays off in the long run.

On another note, briefly describing what things you tried so far helps a lot in avoiding the "don't be lazy/stupid" response - it happens a lot because a lot of people that come here are lazy or stupid.

Oh and, welcome to the forums.

Re: int13_diskette: unsupported AH=80

Posted: Sun Nov 29, 2009 5:55 pm
by PatrickV
quote="jh302"]The floppy image is created with bximage[/quote]
You wont be able to read this because the image because it has to be in binary form. I don't know what format it will be saved in. I assume you have not have the floppy disk loaded of course.
jh302 wrote: mov $2,%ah
mov $18,%al
mov $0,%ch
mov $2,%dh
mov $1,%cl
You are reading raw sectors. You may have issues located your code if yoiu don't have the correct sectors etc.
You have made a lot of mistakes i guess you should start doing some reading or look at other peoples examples

Patrick V