Rev 171 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 171 | Rev 321 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | ;; ;; |
2 | ;; ;; |
3 | ;; System service for filesystem call ;; |
3 | ;; System service for filesystem call ;; |
4 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
4 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
5 | ;; 29.04.2006 Elimination of hangup after the ;; |
5 | ;; 29.04.2006 Elimination of hangup after the ;; |
6 | ;; expiration hd_wait_timeout (for LBA) - Mario79 ;; |
6 | ;; expiration hd_wait_timeout (for LBA) - Mario79 ;; |
7 | ;; xx.04.2006 LFN support - diamond ;; |
- | |
8 | ;; 15.01.2005 get file size/attr/date, file_append (only for hd) - ATV ;; |
7 | ;; 15.01.2005 get file size/attr/date, file_append (only for hd) - ATV ;; |
9 | ;; 23.11.2004 test if hd/partition is set - ATV ;; |
8 | ;; 23.11.2004 test if hd/partition is set - ATV ;; |
10 | ;; 18.11.2004 get_disk_info and more error codes - ATV ;; |
9 | ;; 18.11.2004 get_disk_info and more error codes - ATV ;; |
11 | ;; 08.11.2004 expand_pathz and rename (only for hd) - ATV ;; |
10 | ;; 08.11.2004 expand_pathz and rename (only for hd) - ATV ;; |
12 | ;; 20.10.2004 Makedir/Removedir (only for hd) - ATV ;; |
11 | ;; 20.10.2004 Makedir/Removedir (only for hd) - ATV ;; |
Line 35... | Line 34... | ||
35 | 34 | ||
36 | ; IN: |
35 | ; IN: |
37 | ; |
36 | ; |
38 | ; eax = 0 ; read file /RamDisk/First 6 |
37 | ; eax = 0 ; read file /RamDisk/First 6 |
39 | ; eax = 1 ; write file /RamDisk/First 33 /HardDisk/First 56 |
- | |
40 | ; eax = 4 ; makedir |
- | |
41 | ; eax = 5 ; rename file/directory |
38 | ; eax = 1 ; write file /RamDisk/First 33 /HardDisk/First 56 |
42 | ; eax = 8 ; lba read |
39 | ; eax = 8 ; lba read |
43 | ; eax = 15 ; get_disk_info |
40 | ; eax = 15 ; get_disk_info |
44 | ; |
41 | ; |
45 | ; OUT: |
42 | ; OUT: |
Line 85... | Line 82... | ||
85 | ; Extract parameters |
82 | ; Extract parameters |
86 | add eax, std_application_base_address ; abs start of info block |
83 | add eax, std_application_base_address ; abs start of info block |
Line 87... | Line 84... | ||
87 | 84 | ||
88 | cmp dword [eax+0],15 ; GET_DISK_INFO |
85 | cmp dword [eax+0],15 ; GET_DISK_INFO |
89 | je fs_info |
- | |
90 | cmp dword [eax+0],5 ; RENAME - dont care about read&write blocks |
- | |
91 | je fs_read |
- | |
92 | cmp dword [eax+0],4 ; MAKEDIR - dont care about read&write blocks |
- | |
Line 93... | Line 86... | ||
93 | je fs_read |
86 | je fs_info |
94 | 87 | ||
95 | cmp dword [0x3000],1 ; no memory checks for kernel requests |
88 | cmp dword [0x3000],1 ; no memory checks for kernel requests |
96 | jz no_checks_for_kernel |
89 | jz no_checks_for_kernel |
Line 382... | Line 375... | ||
382 | call reserve_hd1 |
375 | call reserve_hd1 |
383 | mov [hdbase],0x170 |
376 | mov [hdbase],0x170 |
384 | mov [hdid],0x10 |
377 | mov [hdid],0x10 |
385 | mov [hdpos],4 |
378 | mov [hdpos],4 |
386 | fs_yesharddisk_partition: |
379 | fs_yesharddisk_partition: |
- | 380 | call reserve_hd_channel |
|
387 | ; call choice_necessity_partition |
381 | ; call choice_necessity_partition |
388 | ; jmp fs_yesharddisk_all |
382 | ; jmp fs_yesharddisk_all |
389 | jmp fs_for_new_semantic |
383 | jmp fs_for_new_semantic |
Line 390... | Line 384... | ||
390 | 384 | ||
Line 443... | Line 437... | ||
443 | cmp [hdpos],0 ; is hd base set? |
437 | cmp [hdpos],0 ; is hd base set? |
444 | jz hd_err_return |
438 | jz hd_err_return |
445 | cmp [fat32part],0 ; is partition set? |
439 | cmp [fat32part],0 ; is partition set? |
446 | jnz @f |
440 | jnz @f |
447 | hd_err_return: |
441 | hd_err_return: |
- | 442 | call free_hd_channel |
|
448 | and [hd1_status], 0 |
443 | and [hd1_status], 0 |
449 | jmp file_system_return |
444 | jmp file_system_return |
450 | @@: |
445 | @@: |
Line 451... | Line 446... | ||
451 | 446 | ||
Line 467... | Line 462... | ||
467 | call file_read |
462 | call file_read |
Line 468... | Line 463... | ||
468 | 463 | ||
469 | mov edi,[esp+0] |
464 | mov edi,[esp+0] |
Line -... | Line 465... | ||
- | 465 | mov byte [edi],'/' |
|
- | 466 | ||
470 | mov byte [edi],'/' |
467 | call free_hd_channel |
Line 471... | Line 468... | ||
471 | 468 | and [hd1_status], 0 |
|
Line 491... | Line 488... | ||
491 | mov edi,[esp+0] |
488 | mov edi,[esp+0] |
492 | mov byte [edi],'/' |
489 | mov byte [edi],'/' |
Line 493... | Line 490... | ||
493 | 490 | ||
Line -... | Line 491... | ||
- | 491 | ; eax=0 ok - eax=1 not enough free space |
|
- | 492 | ||
494 | ; eax=0 ok - eax=1 not enough free space |
493 | call free_hd_channel |
Line 495... | Line 494... | ||
495 | 494 | and [hd1_status], 0 |
|
Line 496... | Line -... | ||
496 | jmp file_system_return |
- | |
497 | - | ||
498 | - | ||
499 | fs_noharddisk_write: |
- | |
500 | - | ||
501 | cmp dword [esp+20],4 ; MAKEDIR |
- | |
502 | jne fs_noharddisk_makedir |
- | |
503 | - | ||
504 | mov eax,[esp+0] ; /dirname |
- | |
505 | mov byte [eax],0 ; path to asciiz |
- | |
506 | inc eax ; filename start |
- | |
507 | mov edx,[esp+4] |
- | |
508 | add edx,12*2 ; path start |
- | |
509 | - | ||
510 | call makedir |
- | |
511 | - | ||
512 | mov edi,[esp+0] |
- | |
513 | mov byte [edi],'/' |
- | |
514 | - | ||
515 | jmp file_system_return |
- | |
516 | - | ||
517 | fs_noharddisk_makedir: |
- | |
518 | - | ||
519 | cmp dword [esp+20],5 ; RENAME |
- | |
520 | jne fs_noharddisk_rename |
- | |
521 | - | ||
522 | mov edi,[esp+0] ; start of source file name |
- | |
523 | add edi,12+1 ; continue after name |
- | |
524 | call expand_pathz ; convert destination name |
- | |
525 | - | ||
Line 526... | Line -... | ||
526 | mov eax,[edi+1] |
- | |
527 | cmp eax,'HD ' |
- | |
528 | je fs_rename_test1 |
- | |
529 | cmp eax,'HARD' |
- | |
530 | jne fs_rename_error |
- | |
531 | - | ||
532 | fs_rename_test1: |
- | |
533 | mov eax,[edi+1+12] |
- | |
534 | cmp eax,'1 ' |
- | |
535 | je fs_rename_start |
- | |
536 | cmp eax,'FIRS' |
- | |
537 | jne fs_rename_error |
- | |
538 | - | ||
539 | fs_rename_start: |
- | |
540 | mov byte [ebx],0 ; path to asciiz |
- | |
541 | inc ebx ; filename start |
- | |
542 | add edi,12*2 ; path start |
- | |
543 | cmp byte [ebx],0 |
- | |
544 | je fs_rename_error |
- | |
545 | cmp byte [ebx],32 |
- | |
546 | je fs_rename_error |
- | |
547 | - | ||
548 | mov eax,[esp+0] ; /filename |
495 | jmp file_system_return |
549 | mov byte [eax],0 ; path to asciiz |
- | |
550 | inc eax ; filename start |
- | |
551 | mov edx,[esp+4] |
- | |
552 | add edx,12*2 ; path start |
- | |
553 | - | ||
554 | call rename |
- | |
555 | - | ||
556 | mov edi,[esp+0] |
- | |
557 | mov byte [edi],'/' |
496 | |
558 | - | ||
559 | jmp file_system_return |
- | |
Line 560... | Line 497... | ||
560 | 497 | ||
561 | fs_rename_error: |
498 | fs_noharddisk_write: |
562 | mov eax,4 ; partition not defined at hd |
499 | |
563 | jmp file_system_return |
500 |