Rev 3442 | Rev 3539 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3442 | Rev 3525 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
7 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
8 | ;; Addings by M.Lisovin ;; |
8 | ;; Addings by M.Lisovin ;; |
9 | ;; LFN support by diamond ;; |
9 | ;; LFN support by diamond ;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 11... | Line 11... | ||
11 | 11 | ||
Line 12... | Line 12... | ||
12 | $Revision: 3442 $ |
12 | $Revision: 3525 $ |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 1599... | Line 1599... | ||
1599 | @@: |
1599 | @@: |
1600 | inc ecx |
1600 | inc ecx |
1601 | cmp ecx, eax |
1601 | cmp ecx, eax |
1602 | jb .scan_cont |
1602 | jb .scan_cont |
1603 | ; found! |
1603 | ; found! |
- | 1604 | ; If creating a directory, allocate one data cluster now and fail immediately |
|
- | 1605 | ; if this is impossible. This prevents from creating an invalid directory entry |
|
1604 | ; calculate name checksum |
1606 | ; on a full disk. |
- | 1607 | ; yup, the argument is quite non-intuitive... but what should I do if |
|
- | 1608 | ; the entire function uses such arguments? BTW, it refers to al from pushad, |
|
- | 1609 | ; which in turn is filled with 0 in fs_RamdiskRewrite and 1 in fs_RamdiskCreateFolder. |
|
1605 | push esi ecx |
1610 | push esi ecx |
- | 1611 | cmp byte [esp+24+12+20+28], 0 |
|
- | 1612 | jz .no.preallocate.folder.data |
|
- | 1613 | mov ecx, 2849 |
|
- | 1614 | mov edi, RAMDISK_FAT |
|
- | 1615 | xor eax, eax |
|
- | 1616 | repnz scasw |
|
- | 1617 | jz @f |
|
- | 1618 | add esp, 24 |
|
- | 1619 | jmp .disk_full |
|
- | 1620 | @@: |
|
- | 1621 | mov [esp+24+12+20+20], edi ; store the cluster somewhere |
|
- | 1622 | .no.preallocate.folder.data: |
|
- | 1623 | ; calculate name checksum |
|
1606 | mov esi, [esp+8+8] |
1624 | mov esi, [esp+8+8] |
1607 | mov ecx, 11 |
1625 | mov ecx, 11 |
1608 | xor eax, eax |
1626 | xor eax, eax |
1609 | @@: |
1627 | @@: |
1610 | ror al, 1 |
1628 | ror al, 1 |
Line 1670... | Line 1688... | ||
1670 | jz .doit |
1688 | jz .doit |
1671 | ; create directory |
1689 | ; create directory |
1672 | mov byte [edi+11], 10h ; attributes: folder |
1690 | mov byte [edi+11], 10h ; attributes: folder |
1673 | mov ecx, 32*2 |
1691 | mov ecx, 32*2 |
1674 | mov edx, edi |
1692 | mov edx, edi |
- | 1693 | push edx |
|
- | 1694 | push ecx |
|
- | 1695 | push edi |
|
- | 1696 | add edi, 26 ; edi points to low word of cluster |
|
- | 1697 | push edi |
|
- | 1698 | mov edi, [esp+16+20+20] |
|
- | 1699 | jmp .doit2 |
|
1675 | .doit: |
1700 | .doit: |
1676 | push edx |
1701 | push edx |
1677 | push ecx |
1702 | push ecx |
1678 | push edi |
1703 | push edi |
1679 | add edi, 26 ; edi points to low word of cluster |
1704 | add edi, 26 ; edi points to low word of cluster |
Line 1684... | Line 1709... | ||
1684 | .write_loop: |
1709 | .write_loop: |
1685 | ; allocate new cluster |
1710 | ; allocate new cluster |
1686 | xor eax, eax |
1711 | xor eax, eax |
1687 | repnz scasw |
1712 | repnz scasw |
1688 | jnz .disk_full2 |
1713 | jnz .disk_full2 |
- | 1714 | .doit2: |
|
1689 | dec edi |
1715 | dec edi |
1690 | dec edi |
1716 | dec edi |
Line 1691... | Line 1717... | ||
1691 | 1717 |