Assembly 在int 13中格式化原始硬盘

Assembly 在int 13中格式化原始硬盘,assembly,x86,filesystems,nasm,Assembly,X86,Filesystems,Nasm,我想使用汇编更改硬盘驱动器的文件系统。 我在中找到了固定磁盘格式的曲目,但找不到 明白 ;not succesful mov ax,0 mov es,ax mov ah,05h mov al,08h mov ch,01h mov dh,00h mov dl,80h mov bx,type int 13h cmp ah,00 jne error suc: ret error: hlt type: dw 00,00,08,03 我已经在我的操作系统中尝试了这个例子。调用此函数时,它将停止。在快速检

我想使用汇编更改硬盘驱动器的文件系统。 我在中找到了固定磁盘格式的曲目,但找不到 明白

;not succesful
mov ax,0
mov es,ax
mov ah,05h
mov al,08h
mov ch,01h
mov dh,00h
mov dl,80h
mov bx,type
int 13h
cmp ah,00
jne error
suc:
ret
error:
hlt
type:
dw 00,00,08,03

我已经在我的操作系统中尝试了这个例子。调用此函数时,它将停止。

在快速检查时,您将
es
设置为
0
,但
类型
可能不在数据段
0
中。您的
类型
缓冲区是8个字节,但是
int13h
的文档说明您需要512字节的缓冲区。可能还有其他问题…好的,但我尝试了这种类型乘以512 dw 00,00,08,03?更改硬盘上的文件系统只需要将必要的字节结构写入磁盘-不涉及低级格式。如果你是对的,我必须做什么?