Added programs to properly test inter-segment file read and write

This commit is contained in:
Xnoe 2021-08-30 08:11:11 +01:00
parent 703a23dfab
commit a33c25d744
Signed by: xnoe
GPG Key ID: 45AC398F44F0DAFE
3 changed files with 47 additions and 2 deletions

View File

@ -1,8 +1,9 @@
disk.img: boot.sector kernel.bin hello.bin
disk.img: boot.sector kernel.bin hello.bin print.bin hello.txt
dd if=/dev/zero of=disk.img count=43 bs=100k
dd if=boot.sector of=disk.img conv=notrunc
mount disk.img img.d
cp *.bin img.d/
cp hello.txt img.d/
umount img.d
chmod 777 disk.img
@ -13,4 +14,7 @@ kernel.bin: kernel.asm
nasm kernel.asm -o $@
hello.bin: hello.asm
nasm hello.asm -o $@
nasm hello.asm -o $@
print.bin: print.asm
nasm print.asm -o $@

5
hello.txt Normal file
View File

@ -0,0 +1,5 @@
HELLO WORLD!
THIS IS A TEST MESSAGE TO SEE IF I CAN LOAD AND PRINT THIS FILE!
WOOOOOOO

36
print.asm Normal file
View File

@ -0,0 +1,36 @@
mov ax, 3000h
mov ds, ax
mov si, filename
mov ah, 4
int 22h
cmp ax, 0
je error
mov si, ax
mov di, 0
mov bx, 4000h
mov ah, 3
int 22h
mov ax, 4000h
mov ds, ax
mov si, 0
mov ah, 1
int 22h
mov ax, 2000h
mov ds, ax
jmp exit
error:
mov si, err_msg
mov ah, 1
int 22h
exit:
retf
filename db "HELLO TXT"
err_msg db "HELLO.TXT Missing!"