home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,136 of 4,255   
   Mike Gonta to wolfgang kern   
   Re: shortest FAT32   
   18 Mar 24 10:04:48   
   
   From: mikegonta@gmail.com   
      
   On 2024-03-18 3:57 a.m., wolfgang kern wrote:   
   > I'm still busy with manual creation of UEFI-GPT conform environment.   
   >   
   > my idea is to make the first partition FAT32, but as small as possible.   
   > because M$-FAT are defined by number of clusters rather then else my   
   > only choice will be to set cluster-size to one sector   
   > [65525 sectors] I need only 512 MB for my OS boot section, what a waste.   
   >   
   > are there other ways to shorten a FAT32 w/o breaking too many rules ?   
   > perhaps by write the first 8 bytes of the FAT ?   
   > __   
   > wolfgang   
      
   This is a skeleton of my Fat32 Floppy Disk, (543 sector FAT32 file   
   system) for 1.44 MB floppy disk.   
   The trick I used was to mark the minimum FAT32 volume of 66602 outside   
   the 1.44 Mb as lost (0x0FFFFFF7) in the file allocation table.   
      
   [code]   
   VOLUME_LENGTH = 66602 ; minimum FAT32 volume = 32.5 MB   
   RESERVED_SECTORS = 21   
   BYTES_PER_SECTOR = 512   
   SECTORS_PER_CLUSTER = 1   
   PARTITION_OFFSET = 0   
   LABEL equ "           " ; 11 characters maximum   
   BYTES_PER_CLUSTER = BYTES_PER_SECTOR*SECTORS_PER_CLUSTER   
   SECTORS_PER_FAT=((VOLUME_LENGTH-RESERVED_SECTORS)+(128*SECTORS_P   
   R_CLUSTER-1))/(128*SECTORS_PER_CLUSTER)   
   START_OF_DATA = RESERVED_SECTORS+SECTORS_PER_FAT   
      
   org 0x7C00   
   boot_sector:   
      times 510-($-boot_sector) db 0   
      dw 0xAA55   
      
   fsi:   
      db "RRaA"   
      times 480 db 0   
      db "rrAa"   
    number of free clusters   
      dd VOLUME_LENGTH-RESERVED_SECTORS-SECTORS_PER_FAT   
      dd 4 ; number of the next free cluster   
      times 12 db 0   
      dd 0xAA550000   
      
      times 7*512 db 0   
      
   upcase_table:   
      times 12*512 db 0   
      
   file_allocation_table:   
      dd 0xFFFFFFF8, 0xFFFFFFFF, 0x0FFFFFFF   
      times 2880-RESERVED_SECTORS-SECTORS_PER_FAT-1 dd 0   
    mark sectors outside 1.44MB as lost   
      times VOLUME_LENGTH-2880 dd 0x0FFFFFF7   
      times SECTORS_PER_FAT*BYTES_PER_SECTOR-($-file_allocation_table) db 0   
      
   root: ; start of data   
      db LABEL   
      db 8 ; volume label   
      db 0   
      db HUNDREDTHS   
      dw (HOURS SHL 11) + (MINUTES SHL 5 )+ SECONDS SHR 2   
      dw ((YEARS - 1980) SHL 9) + (MONTHS SHL 5) + DAYS   
      times 14 db 0   
      times 512-($-root) db 0 ; pre-allocate 1 root directory sector   
    extend to fill 1.44 Mb image   
      times (2880-RESERVED_SECTORS-SECTORS_PER_FAT-1)*512 db 0xF6   
   [/code]   
      
   --   
   Mike Gonta   
   look and see - many look but few see   
      
   https://mikegonta.com   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca