begin working on test bios disk reading subroutine
This commit is contained in:
parent
b8b49b5ce6
commit
9143073dd3
2 changed files with 25 additions and 1 deletions
2
Makefile
2
Makefile
|
|
@ -97,7 +97,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s
|
|||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
$(OBJCOPY) --remove-section .note.gnu.property $@
|
||||
|
||||
MBR_TEST_OBJ = obj/mbr_test.o obj/serial.o obj/itoa.o obj/util.o obj/test_disk_params.o
|
||||
MBR_TEST_OBJ = obj/mbr_test.o obj/serial.o obj/itoa.o obj/util.o obj/test_disk_target.o
|
||||
|
||||
mbr_test: $(MBR_TEST_OBJ) $(DISK)
|
||||
$(LD) -T src/mbr_test.ld -o $(BIN_DIR)/mbr_test.bin $(MBR_TEST_OBJ)
|
||||
|
|
|
|||
24
src/test_disk_read.s
Normal file
24
src/test_disk_read.s
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
.section .text
|
||||
.code16
|
||||
|
||||
.globl test_disk_read
|
||||
|
||||
# eax - LBA address
|
||||
# cx - number of sectors
|
||||
# es:di - destination
|
||||
test_disk_read:
|
||||
# here we need to convert LBA into CHS
|
||||
ret
|
||||
|
||||
# ds:si - sector
|
||||
test_disk_taste_sector:
|
||||
# test pattern partition - each sector has 32 bit integer in beginning
|
||||
# so we read this integer and output it, it must increment as well as LBA address
|
||||
lodsd # load 32 bit into eax
|
||||
mov $str_taste, %si
|
||||
call prints_number
|
||||
|
||||
ret
|
||||
|
||||
.section .rodata
|
||||
str_taste: .asciz "Sector test pattern: "
|
||||
Loading…
Add table
Reference in a new issue