Save work
This commit is contained in:
1 parent
a5ac220a12
commit
ded978bb38
6 files changed
+120
-45
No files matched your search
+57
-26
@@ -1,33 +1,64 @@
|
||||
int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment);
|
||||
int sec_stub();
|
||||
int stub(index, number_sectors, data_buffer, data_buffer_segment);
|
||||
|
||||
int disk_service_read_data_from_disk(index, file_block_size, data_buffer, data_buffer_segment)
|
||||
int stub(index, number_sectors, data_buffer, data_buffer_segment)
|
||||
long* index;
|
||||
long file_block_size;
|
||||
long number_sectors;
|
||||
void* data_buffer;
|
||||
int data_buffer_segment;
|
||||
{
|
||||
//fseek ( disk, (index * SECTOR_SIZE ), SEEK_SET ); // SEEK_SET start offset at index 0 and move 1 * SECTOR_SIZE, and write here.
|
||||
//int read = fread(data_buffer, 1, (file_block_size * SECTOR_SIZE), disk);
|
||||
//return read;
|
||||
#asm
|
||||
lsfs_load_data:
|
||||
mov dl, [global_disk_identifier]
|
||||
mov WORD [DAPACK.lba_addr_dw_low], ax
|
||||
mov WORD [DAPACK.blkcnt], 0x01
|
||||
mov WORD [DAPACK.db_addr_segment], bx
|
||||
mov WORD [DAPACK.db_addr_offset], FSCI
|
||||
mov si, DAPACK ; address of "disk address packet"
|
||||
mov ah, 0x42 ; READ
|
||||
mov dl, [global_disk_identifier]
|
||||
int 0x13
|
||||
|
||||
DAPACK:
|
||||
.dap_Size: db 0x10 ; This is always 16 bytes (0x10)
|
||||
.rev_byte: db 0x0 ; reserved byte, should always be zero
|
||||
.blkcnt: dw 0x0 ; int 13 resets this to # of blocks actually read/written
|
||||
.db_addr_offset: dw 0x0 ; memory buffer destination address (0:7c00)
|
||||
.db_addr_segment: dw 0x0 ; in memory page zero
|
||||
.lba_addr_dw_low: dd 0x0 ; put the lba to read in this spot
|
||||
.lba_addr_dw_high: dd 0x0 ; more storage bytes only for big lba's ( > 4 bytes )
|
||||
#endasm
|
||||
|
||||
#asm
|
||||
#define index 4[bp];
|
||||
#define number_sectors 6[bp];
|
||||
#define data_buffer 8[bp];
|
||||
#define data_buffer_segment 10[bp];
|
||||
|
||||
push bp
|
||||
mov bp,sp
|
||||
pusha
|
||||
//mov ax, ds
|
||||
//call 0x0000:0x7C2A
|
||||
//mov ax, DAPACK
|
||||
//call 0x0000:0x7C2A
|
||||
mov ax, #DAPACK
|
||||
call 0x0000:0x7C2A
|
||||
|
||||
lsfs_load_data:
|
||||
mov ax, index
|
||||
mov WORD [DAPACK.lba_addr_dw_low], ax
|
||||
mov bx, number_sectors
|
||||
mov WORD [DAPACK.blkcnt], bx
|
||||
mov cx, data_buffer_segment
|
||||
mov WORD [DAPACK.db_addr_segment], cx
|
||||
mov dx, data_buffer;
|
||||
mov WORD [DAPACK.db_addr_offset], dx
|
||||
mov si, #DAPACK ; address of
|
||||
mov ah, #0x42 ; READ
|
||||
mov dl, [global_disk_identifier]
|
||||
int #0x13
|
||||
call 0x0000:0x7C2A
|
||||
popa
|
||||
pop bp
|
||||
ret
|
||||
|
||||
|
||||
DAPACK:
|
||||
DAPACK.dap_Size: db 0x10
|
||||
DAPACK.rev_byte: db 0x0
|
||||
DAPACK.blkcnt: dw 0x0
|
||||
DAPACK.db_addr_offset: dw 0x0
|
||||
DAPACK.db_addr_segment: dw 0x0
|
||||
DAPACK.lba_addr_dw_low: dd 0x0
|
||||
DAPACK.lba_addr_dw_high: dd 0x0
|
||||
|
||||
global_disk_identifier: db 0x80
|
||||
|
||||
#endasm
|
||||
}
|
||||
|
||||
int sec_stub()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
Reference in new issue
Block a user