Added programs to properly test inter-segment file read and write
This commit is contained in:
parent
703a23dfab
commit
a33c25d744
8
Makefile
8
Makefile
@ -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
5
hello.txt
Normal 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
36
print.asm
Normal 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!"
|
Loading…
x
Reference in New Issue
Block a user