]> cloudbase.mooo.com Git - avrcpm.git/commitdiff
git-svn-id: svn://cu.loc/avr-cpm/branches/fat16-test@132 57430480-672e-4586-8877...
authorFrank Zoll <fzoll@web.de>
Thu, 7 Oct 2010 18:01:58 +0000 (18:01 +0000)
committerFrank Zoll <fzoll@web.de>
Thu, 7 Oct 2010 18:01:58 +0000 (18:01 +0000)
dsk_fat16.asm
dsk_mgr.asm
init.asm

index 42c3ae0cfabc9ded7fc2f4c03588339b957bdc5e..b0e9be14b86ab10932a6932054f7516717336ac1 100644 (file)
@@ -36,7 +36,8 @@
 ;                              Defines for FAT16 Structures
 ; ############################################################################ 
 
-#define PARTID_FAT16 0x0E
+#define PARTID1_FAT16 0x0E
+#define PARTID2_FAT16 0x06
 
 /*These are the Offsets to the Variables within the Bootsector of a FAT16
   Partition.
@@ -49,7 +50,8 @@
 #define FAT16_BSO_NUMFATCP     0x10    ; Offset to Ammount of FAT Copys
 #define FAT16_BSO_NUMDIRENT    0x11    ; Offset to Max. Root Dir. Entrys
 #define        FAT16_FIRST_IMAGENAME   'A'     ; First letter of filename to search 
-#define FAT16_LAST_IMAGENAME    'Z'    ; Last letter of filename to search 
+#define FAT16_LAST_IMAGENAME    'A'+MAXDISKS-1 ; Last letter of filename to 
+                                               ; search 
 
 ; ############################################################################ 
 ;                              Start of Data Segment
index 4b108a301a07a8472f457a20def900d2f4b7a0d9..e48052c28f94c08b658c90811d4227869c6de405 100644 (file)
@@ -150,14 +150,21 @@ mgr_ploop2:
 ;      Get Partitiontype\r
        ldd             temp,z+PART_TYPE\r
 \r
-;   Test for FAT Partition\r
-       cpi             temp,PARTID_FAT16\r
+;   Test for FAT Partition Type 1\r
+       cpi     temp,PARTID1_FAT16\r
+       brne    mgr_nextp1\r
+       \r
+       rcall   fat_add_partition\r
+       rjmp    mgr_pend\r
+\r
+;   Test for FAT Partition Type 2\r
+mgr_nextp1:\r
+       cpi     temp,PARTID2_FAT16\r
        brne    mgr_nextp2\r
        \r
-       rcall    fat_add_partition\r
+       rcall   fat_add_partition\r
+       rjmp    mgr_pend        \r
 \r
-       rjmp    mgr_pend\r
-               \r
 mgr_nextp2:\r
        adiw    zl,16\r
        cpi             zl,low(hostbuf+510)\r
@@ -172,11 +179,10 @@ mgr_pend:
        rcall   rdsk_add_partition\r
 #endif\r
 \r
-/*\r
-   Don't use change info. It doesn't word reliably with partitions, \r
-   and it doesn't work at all with fat images:\r
-*/\r
-#define CHANGEINFO 0\r
+;      Save ammount of found CP/M Partitions\r
+       sts     ndisks,temp3\r
+       tst     temp3\r
+       breq    mgr_fat\r
 \r
 ;Store new partitions and check if the SD card has been changed.\r
 \r
@@ -186,36 +192,36 @@ mgr_pend:
        clt\r
 \r
 mgr_pcpl:\r
-       ld              temp,y+\r
-       ld              temp2,z\r
-       st              z+,temp\r
+       ld      temp,y+\r
+       ld      temp2,z\r
+       st      z+,temp\r
        cpse    temp,temp2\r
        set\r
-       dec             temp4\r
+       dec     temp4\r
        brne    mgr_pcpl\r
 \r
-       mov             temp,temp3\r
-       sts             ndisks,temp\r
-#if CHANGEINFO\r
+       mov     temp,temp3\r
+       sts     ndisks,temp\r
+\r
        brtc    mgr_pcpe\r
 \r
 ;      SD card changed.\r
-#endif\r
-       tst             temp\r
-       breq    mgr_pcpe\r
 \r
+       tst     temp\r
+       breq    mgr_pcpe\r
 \r
+mgr_fat:\r
 #if FAT16_SUPPORT\r
        rcall fat_scan_partition\r
-       rcall fat_reset_cache
+       rcall fat_reset_cache\r
 #endif\r
+\r
        lds             temp,ndisks\r
-#if CHANGEINFO\r
        sbr             temp,0x80\r
-#endif\r
 \r
 mgr_pcpe:\r
 \r
+\r
        tst     temp\r
        ret\r
 \r
@@ -237,19 +243,19 @@ mgr_prnt_parttbl:
        lds             yl,ndisks\r
        ldi             xh,'A'\r
 \r
-pprl:
-       ldd             temp ,z+1               ;Get partition start
-       ldd             temp2,z+2
-       ldd             temp3,z+3
-       ldd             temp4,z+4
+pprl:\r
+       ldd             temp ,z+1               ;Get partition start\r
+       ldd             temp2,z+2\r
+       ldd             temp3,z+3\r
+       ldd             temp4,z+4\r
 \r
        printnewline\r
 \r
-       cp              temp,_0                 ;If zero ...
-       cpc             temp2,_0
-       cpc             temp3,_0
-       cpc             temp4,_0
-       breq    mgr_prnop               ;... no partition table at 0
+       cp              temp,_0                 ;If zero ...\r
+       cpc             temp2,_0\r
+       cpc             temp3,_0\r
+       cpc             temp4,_0\r
+       breq    mgr_prnop               ;... no partition table at 0\r
 \r
 ; Partitiontype examining\r
        ldd     xl,z+0\r
@@ -284,7 +290,7 @@ mgr_prnop:
        rcall   mgr_prnt_image\r
 \r
 mgr_prnt_size:\r
-       call    print_ultoa
+       call    print_ultoa\r
        printstring ", size: "\r
 \r
        ldd             temp ,z+5                       ;Get partition size\r
@@ -296,15 +302,15 @@ mgr_prnt_size:
        ror             temp3\r
        ror             temp2\r
        ror             temp\r
-       call    print_ultoa
+       call    print_ultoa\r
        printstring "KB."\r
 \r
 mgr_goto_next_part:    \r
        adiw    z,PARTENTRY_SIZE\r
-       inc             xh
+       inc             xh\r
        dec             yl\r
        tst             yl\r
-       brne    pprl
+       brne    pprl\r
 \r
 mgr_pppre:\r
        ret\r
@@ -326,9 +332,9 @@ mgr_prnt_fatsize:
 \r
 mgr_prnt_diskname:\r
        push    temp\r
-       mov temp,xh
+       mov temp,xh\r
        call uartputc\r
-       ldi temp,':'
+       ldi temp,':'\r
        call uartputc\r
        pop             temp\r
        ret\r
index de576a8608cbb2710b4c23b66b6eb30aa1eccaf2..4ffff96751146fe23503e3211ed2cf09f066c5e9 100644 (file)
--- a/init.asm
+++ b/init.asm
@@ -227,11 +227,21 @@ boot_ipl2:
 
 ; Read first sector of first CP/M partition (ipl)
 
-       lds     xl,hostparttbl+1
-       lds     xh,hostparttbl+2
-       lds     yl,hostparttbl+3
-       lds     yh,hostparttbl+4
-       rcall   mmcReadSect
+;      lds     xl,hostparttbl+1
+;      lds     xh,hostparttbl+2
+;      lds     yl,hostparttbl+3
+;      lds     yh,hostparttbl+4
+;      rcall   mmcReadSect
+
+;      Disk 0
+       sts     seekdsk,_0
+;      Track 0
+       sts     seektrk,_0
+       sts     seektrk+1,_0
+;      Sector 0
+       sts     seeksec,_0
+
+       rcall   dsk_read
 
 ;      rcall   dsk_cboot               ;init (de)blocking buffer