您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

32 行
1.3 KiB

  1. int disk_service_read_data_from_disk(index, file_block_size, data_buffer, data_buffer_segment)
  2. long* index;
  3. long file_block_size;
  4. void* data_buffer;
  5. int data_buffer_segment;
  6. {
  7. //fseek ( disk, (index * SECTOR_SIZE ), SEEK_SET ); // SEEK_SET start offset at index 0 and move 1 * SECTOR_SIZE, and write here.
  8. //int read = fread(data_buffer, 1, (file_block_size * SECTOR_SIZE), disk);
  9. //return read;
  10. #asm
  11. lsfs_load_data:
  12. mov dl, [global_disk_identifier]
  13. mov WORD [DAPACK.lba_addr_dw_low], ax
  14. mov WORD [DAPACK.blkcnt], 0x01
  15. mov WORD [DAPACK.db_addr_segment], bx
  16. mov WORD [DAPACK.db_addr_offset], FSCI
  17. mov si, DAPACK ; address of "disk address packet"
  18. mov ah, 0x42 ; READ
  19. mov dl, [global_disk_identifier]
  20. int 0x13
  21. DAPACK:
  22. .dap_Size: db 0x10 ; This is always 16 bytes (0x10)
  23. .rev_byte: db 0x0 ; reserved byte, should always be zero
  24. .blkcnt: dw 0x0 ; int 13 resets this to # of blocks actually read/written
  25. .db_addr_offset: dw 0x0 ; memory buffer destination address (0:7c00)
  26. .db_addr_segment: dw 0x0 ; in memory page zero
  27. .lba_addr_dw_low: dd 0x0 ; put the lba to read in this spot
  28. .lba_addr_dw_high: dd 0x0 ; more storage bytes only for big lba's ( > 4 bytes )
  29. #endasm
  30. }