📄 ide.cod
字号:
00174 |$L37224|
; 381 : }
; 382 : else if (stat)
00174 e3500000 cmp r0, #0
00178 1a00001e bne |$L37459|
; 386 : }
; 387 :
; 388 : // Display Record Header
; 389 : DEBUGMSG(ZONE_INFO, (TEXT("Record Header:\r\n")));
0017c e59f00c4 ldr r0, [pc, #0xC4]
00180 eb000000 bl EdbgOutputDebugString
; 390 : DEBUGMSG(ZONE_INFO, (TEXT("------------------------------------------\r\n")));
00184 e59f00b8 ldr r0, [pc, #0xB8]
00188 eb000000 bl EdbgOutputDebugString
; 391 : DEBUGMSG(ZONE_INFO, (TEXT("Record Address = 0x%x\r\n"), rechdr.recaddr));
0018c e59d100c ldr r1, [sp, #0xC]
00190 e59f00a8 ldr r0, [pc, #0xA8]
00194 eb000000 bl EdbgOutputDebugString
; 392 : DEBUGMSG(ZONE_INFO, (TEXT("Record Length = 0x%x\r\n"), rechdr.reclen));
00198 e59d1010 ldr r1, [sp, #0x10]
0019c e59f0098 ldr r0, [pc, #0x98]
001a0 eb000000 bl EdbgOutputDebugString
; 393 : DEBUGMSG(ZONE_INFO, (TEXT("Record CheckSum = 0x%x\r\n"), rechdr.recchksum));
001a4 e59d1014 ldr r1, [sp, #0x14]
001a8 e59f0088 ldr r0, [pc, #0x88]
001ac eb000000 bl EdbgOutputDebugString
; 394 :
; 395 : // Last Header
; 396 : if (rechdr.recaddr == 0 && rechdr.recchksum == 0)
001b0 e59d300c ldr r3, [sp, #0xC]
001b4 e3530000 cmp r3, #0
001b8 1a000002 bne |$L37240|
001bc e59d0014 ldr r0, [sp, #0x14]
001c0 e3500000 cmp r0, #0
001c4 0a00000d beq |$L37226|
001c8 |$L37240|
; 397 : break;
; 398 :
; 399 : stat = file_read((unsigned char *)rechdr.recaddr, rechdr.reclen);
001c8 e59d1010 ldr r1, [sp, #0x10]
001cc e1a00003 mov r0, r3
001d0 eb000000 bl file_read
001d4 e3500000 cmp r0, #0
; 400 : if (stat)
001d8 1a00000a bne |$L37461|
001dc |$L37471|
; 372 :
; 373 : do
; 374 : {
; 375 : // Get record header
; 376 : stat = file_read((unsigned char *)&rechdr, sizeof(RECHDR));
001dc e28d000c add r0, sp, #0xC
001e0 e3a0100c mov r1, #0xC
001e4 eb000000 bl file_read
; 377 : if (stat == FAT_EOF)
001e8 e1500008 cmp r0, r8
001ec 1affffe0 bne |$L37224|
; 378 : {
; 379 : RETAILMSG(1, (TEXT("ERROR: EOF reading record header.\r\n")));
001f0 e59f003c ldr r0, [pc, #0x3C]
; 380 : return(-1);
001f4 ea000006 b |$L37469|
001f8 |$L37459|
; 383 : {
; 384 : RETAILMSG(1, (TEXT("ERROR: File read failed.\r\n")));
001f8 e59f0030 ldr r0, [pc, #0x30]
; 385 : return(-1);
001fc ea000004 b |$L37469|
00200 |$L37226|
; 407 : }
; 408 :
; 409 : }
; 410 : while(1);
; 411 :
; 412 : // Close file
; 413 : file_close();
00200 eb000000 bl file_close
; 414 :
; 415 : return(0);
00204 ea000004 b |$L37195|
00208 |$L37461|
; 401 : {
; 402 : if (stat == EOF)
00208 e3700001 cmn r0, #1
0020c 1a000001 bne |$L37247|
; 403 : RETAILMSG(1, (TEXT("ERROR: EOF reading data.\r\n")));
00210 e59f0014 ldr r0, [pc, #0x14]
00214 |$L37469|
00214 eb000000 bl EdbgOutputDebugString
00218 |$L37247|
; 404 : else
; 405 : RETAILMSG(1, (TEXT("ERROR: File read failed.\r\n")));
; 406 : return(-1);
00218 e3e07000 mvn r7, #0
0021c |$L37195|
; 327 : return(-1);
0021c e1a00007 mov r0, r7
; 416 : }
00220 e28dd02c add sp, sp, #0x2C
00224 e8bd41f0 ldmia sp!, {r4 - r8, lr}
00228 e12fff1e bx lr
0022c |$L37476|
0022c 00000000 DCD |??_C@_0BL@OANF@ERROR?3?5EOF?5reading?5data?4?$AN?6?$AA@|
00230 00000000 DCD |??_C@_0BL@GAGB@ERROR?3?5File?5read?5failed?4?$AN?6?$AA@|
00234 00000000 DCD |??_C@_0CE@OOJP@ERROR?3?5EOF?5reading?5record?5header@|
00238 00000000 DCD |??_C@_0BJ@IAAG@Record?5CheckSum?5?$DN?50x?$CFx?$AN?6?$AA@|
0023c 00000000 DCD |??_C@_0BJ@HCEC@Record?5Length?5?5?5?$DN?50x?$CFx?$AN?6?$AA@|
00240 00000000 DCD |??_C@_0BJ@BGIE@Record?5Address?5?5?$DN?50x?$CFx?$AN?6?$AA@|
00244 00000000 DCD |??_C@_0CN@GCHE@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@|
00248 00000000 DCD |??_C@_0BB@JKGB@Record?5Header?3?$AN?6?$AA@|
0024c 00000000 DCD |??_C@_0BH@PLBO@Image?5Length?5?5?$DN?50x?$CFx?$AN?6?$AA@|
00250 00000000 DCD |??_C@_0BH@DNOO@Image?5Address?5?$DN?50x?$CFx?$AN?6?$AA@|
00254 00000000 DCD |??_C@_0CB@CJKF@Sync?5Bytes?5?5?5?5?$DN?5?8?$CFc?$CFc?$CFc?$CFc?$CFc?$CFc?8?$AN?6@|
00258 00000000 DCD |??_C@_0CO@DKHE@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@|
0025c 00000000 DCD |??_C@_0BA@LPOH@Image?5Header?3?$AN?6?$AA@|
00260 00000000 DCD |??_C@_0CD@FELD@ERROR?3?5EOF?5reading?5image?5header?4@|
00264 00000000 DCD |??_C@_0CE@OECD@ERROR?3?5FAT?5initialization?5failed@|
00268 00000000 DCD |??_C@_0CL@CPEM@ERROR?3?5IDE?5device?5initialization@|
0026c 00000000 DCD |g_bstartcounting|
00270 00000000 DCD |g_sectorsread|
00274 00000000 DCD |??_C@_04JPBA@B5?$AN?6?$AA@|
00278 |$M37473|
ENDP ; |load_image_ide|
EXPORT |OEMHDDPlatformInit|
00000 AREA |.text| { |OEMHDDPlatformInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMHDDPlatformInit|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMHDDPlatformInit| } ; comdat associative
|$T37482| DCD |OEMHDDPlatformInit|
DCD 0x40000200
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMHDDPlatformInit| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMHDDPlatformInit| PROC
; 420 : {
00000 |$M37480|
; 421 :
; 422 : // For now, the RTL8139 product NIC driver requires an ILR in the PCI
; 423 : // config space header otherwise it isn't able to get interrupts...
; 424 : //
; 425 : //InitNIC();
; 426 :
; 427 :
; 428 : return(TRUE);
00000 e3a00001 mov r0, #1
; 429 : }
00004 e12fff1e bx lr
00008 |$M37481|
ENDP ; |OEMHDDPlatformInit|
EXPORT |OEMHDDPreDownload|
EXPORT |??_C@_06FMPI@nk?4bin?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_0DA@EFIH@Initializing?5IDE?5drive?5?$CImay?5take@| [ DATA ] ; `string'
00000 AREA |.text| { |OEMHDDPreDownload| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMHDDPreDownload|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMHDDPreDownload| } ; comdat associative
|$T37490| DCD |OEMHDDPreDownload|
DCD 0x40003002
00000 AREA |.rdata| { |??_C@_06FMPI@nk?4bin?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_06FMPI@nk?4bin?$AA@| DCB "nk.bin", 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_0DA@EFIH@Initializing?5IDE?5drive?5?$CImay?5take@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_0DA@EFIH@Initializing?5IDE?5drive?5?$CImay?5take@| DCB "Initializi"
DCB "ng IDE drive (may take a second)...", 0xd, 0xa, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMHDDPreDownload| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMHDDPreDownload| PROC
; 433 : {
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 e24dd008 sub sp, sp, #8
00008 |$M37488|
; 434 : UCHAR pName[] = KIMAGE_NAME;
00008 e59f20ac ldr r2, [pc, #0xAC]
; 435 :
; 436 : //
; 437 : g_bstartcounting = 0;
0000c e3a05000 mov r5, #0
00010 e59f40a0 ldr r4, [pc, #0xA0]
00014 e5920000 ldr r0, [r2]
00018 e1d210b4 ldrh r1, [r2, #4]
0001c e58d0000 str r0, [sp]
; 438 : g_sectorsread = 0;
00020 e59f008c ldr r0, [pc, #0x8C]
00024 e5d22006 ldrb r2, [r2, #6]
00028 e5805000 str r5, [r0]
; 439 :
; 440 : RETAILMSG(1, (TEXT("Initializing IDE drive (may take a second)...\r\n")));
0002c e59f007c ldr r0, [pc, #0x7C]
00030 e1cd10b4 strh r1, [sp, #4]
00034 e5cd2006 strb r2, [sp, #6]
00038 e5c45000 strb r5, [r4]
0003c eb000000 bl EdbgOutputDebugString
; 441 :
; 442 :
; 443 : //
; 444 : // Set the IDE pcmcia cards attribute space to use memory and reset the PCMCIA card.
; 445 : //
; 446 : //*CF_CONFIG = CONFIG_LEVIRQ | CONFIG_SRESET;
; 447 : *CF_CONFIG = CONFIG_LEVIRQ | 1;
00040 e3a03312 mov r3, #0x12, 6
00044 e3833c02 orr r3, r3, #2, 24
00048 e3a00041 mov r0, #0x41
0004c e5c30000 strb r0, [r3]
; 448 :
; 449 :
; 450 : // Initialize IDE
; 451 : if (init_ide())
00050 eb000000 bl init_ide
00054 e3500000 cmp r0, #0
; 452 : {
; 453 : RETAILMSG(1, (TEXT("ERROR: IDE device initialization failed.\r\n")));
00058 159f004c ldrne r0, [pc, #0x4C]
0005c 1a000008 bne |$L37487|
; 455 : }
; 456 :
; 457 : // Initialize FAT structs
; 458 : if (init_fat())
00060 eb000000 bl init_fat
00064 e3500000 cmp r0, #0
; 459 : {
; 460 : RETAILMSG(1, (TEXT("ERROR: FAT initialization failed.\r\n")));
00068 159f0038 ldrne r0, [pc, #0x38]
0006c 1a000004 bne |$L37487|
; 461 : return(-1);
; 462 : }
; 463 :
; 464 : // Open image (finds starting LBA and size - inits structs for later ops)
; 465 : // Only read is supported
; 466 : if (file_open(pName))
00070 e28d0000 add r0, sp, #0
00074 eb000000 bl file_open
00078 e3500000 cmp r0, #0
0007c 0a000003 beq |$L37263|
; 467 : {
; 468 : RETAILMSG(1, (TEXT("ERROR: File open failed (%s).\r\n"), pName));
00080 e28d0000 add r0, sp, #0
00084 |$L37487|
00084 eb000000 bl EdbgOutputDebugString
; 469 : return(-1);
00088 e3e05000 mvn r5, #0
0008c ea000001 b |$L37253|
00090 |$L37263|
; 470 : }
; 471 :
; 472 : // Display status bar
; 473 : //create_statusbar(&g_statbar, 0, (g_fileinfo.fsize / SECTOR_SIZE) - 1);
; 474 : g_bstartcounting = 1;
00090 e3a00001 mov r0, #1
00094 e5c40000 strb r0, [r4]
00098 |$L37253|
; 454 : return(-1);
00098 e1a00005 mov r0, r5
; 475 :
; 476 : return(BL_DOWNLOAD);
; 477 : }
0009c e28dd008 add sp, sp, #8
000a0 e8bd4030 ldmia sp!, {r4, r5, lr}
000a4 e12fff1e bx lr
000a8 |$L37492|
000a8 00000000 DCD |??_C@_0CE@OECD@ERROR?3?5FAT?5initialization?5failed@|
000ac 00000000 DCD |??_C@_0CL@CPEM@ERROR?3?5IDE?5device?5initialization@|
000b0 00000000 DCD |??_C@_0DA@EFIH@Initializing?5IDE?5drive?5?$CImay?5take@|
000b4 00000000 DCD |g_sectorsread|
000b8 00000000 DCD |g_bstartcounting|
000bc 00000000 DCD |??_C@_06FMPI@nk?4bin?$AA@|
000c0 |$M37489|
ENDP ; |OEMHDDPreDownload|
EXPORT |OEMHDDReadData|
00000 AREA |.text| { |OEMHDDReadData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$OEMHDDReadData|, PDATA, SELECTION=5, ASSOC=|.text| { |OEMHDDReadData| } ; comdat associative
|$T37502| DCD |OEMHDDReadData|
DCD 0x40001601
; Function compile flags: /Ogsy
00000 AREA |.text| { |OEMHDDReadData| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |OEMHDDReadData| PROC
; 481 : {
00000 e52de004 str lr, [sp, #-4]!
00004 |$M37500|
00004 e1a02001 mov r2, r1
; 482 : int stat=0;
; 483 :
; 484 : stat = file_read((unsigned char *)pbData, cbData);
00008 e1a01000 mov r1, r0
0000c e1a00002 mov r0, r2
00010 eb000000 bl file_read
; 485 : if (stat == FAT_EOF)
00014 e3a01cff mov r1, #0xFF, 24
00018 e38110fe orr r1, r1, #0xFE
0001c e1500001 cmp r0, r1
; 486 : {
; 487 : RETAILMSG(1, (TEXT("ERROR: EOF reading record header.\r\n")));
00020 059f002c ldreq r0, [pc, #0x2C]
00024 0a000002 beq |$L37499|
; 488 : return(FALSE);
; 489 : }
; 490 : else if (stat)
00028 e3500000 cmp r0, #0
0002c 0a000004 beq |$L37277|
; 491 : {
; 492 : RETAILMSG(1, (TEXT("ERROR: File read failed.\r\n")));
00030 e59f0018 ldr r0, [pc, #0x18]
00034 |$L37499|
00034 eb000000 bl EdbgOutputDebugString
; 493 : return(FALSE);
00038 e3a00000 mov r0, #0
; 497 : }
0003c e8bd4000 ldmia sp!, {lr}
00040 e12fff1e bx lr
00044 |$L37277|
; 494 : }
; 495 :
; 496 : return(TRUE);
00044 e3a00001 mov r0, #1
; 497 : }
00048 e8bd4000 ldmia sp!, {lr}
0004c e12fff1e bx lr
00050 |$L37504|
00050 00000000 DCD |??_C@_0BL@GAGB@ERROR?3?5File?5read?5failed?4?$AN?6?$AA@|
00054 00000000 DCD |??_C@_0CE@OOJP@ERROR?3?5EOF?5reading?5record?5header@|
00058 |$M37501|
ENDP ; |OEMHDDReadData|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -