uaa

VMware Player 17.5 vlance crash test

uaa
Dec 7th, 2023
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. ; SPDX-License-Identifier: WTFPL
  2. ; nasm test.asm -o test.img
  3.  
  4. lance_base equ 2000h
  5.  
  6. section .text
  7. use16
  8.  
  9. jmp short start
  10. nop
  11.  
  12. ; disk description table (to emulate floppy)
  13. db "TESTCODE" ; OEMLabel
  14. dw 512 ; BytesPerSector
  15. db 1 ; SectorsPerCluster
  16. dw 1 ; ReservedForBoot
  17. db 2 ; NumberOfFats
  18. dw 224 ; RootDirEntries
  19. dw 2880 ; LogicalSectors
  20. db 0f0h ; MediumByte
  21. dw 9 ; SectorsPerFat
  22. dw 18 ; SectorsPerTrack
  23. dw 2 ; Sides
  24. dd 0 ; HiddenSectors
  25. dd 0 ; LargeSectors
  26. dw 0 ; DriveNo
  27. db 41 ; Signature
  28. dd 0 ; VolumeID
  29. db "TESTCODE000" ; VolumeLabel
  30. db "FAT12 " ; FileSystem
  31.  
  32. start:
  33. cli
  34.  
  35. ; WIO/DWIO mode is unknown, try both reset
  36.  
  37. mov dx, (lance_base + 14h)
  38. in ax, dx ; reset (16bit)
  39.  
  40. mov dx, (lance_base + 18h)
  41. in eax, dx ; reset (32bit)
  42.  
  43. mov dx, (lance_base + 10h)
  44. xor eax, eax
  45. out dx, eax ; select CSR0, enter DWIO mode
  46.  
  47. mov dx, (lance_base + 14h)
  48. mov eax, 14h
  49. out dx, eax ; select BCR20
  50.  
  51. mov dx, (lance_base + 1ch)
  52. in eax, dx
  53.  
  54. ; already in DWIO mode
  55.  
  56. mov dx, (lance_base + 18h)
  57. in eax, dx ; reset (32bit)
  58.  
  59. mov dx, (lance_base + 10h)
  60. xor eax, eax
  61. out dx, eax ; select CSR0
  62.  
  63. mov dx, (lance_base + 14h)
  64. mov eax, 14h
  65. out dx, eax ; select BCR20
  66.  
  67. mov dx, (lance_base + 1ch)
  68. in eax, dx ; *** CRASH HERE ***
  69.  
  70. stop:
  71. jmp short stop
  72.  
  73. ; end of boot sector and blank contents
  74. times 510 - ($ - $$) db 0
  75. dw 0aa55h
  76.  
  77. times (2879 * 512) db 0xe5
  78.  
Advertisement
Add Comment
Please, Sign In to add comment