Rev 4572 | Rev 4588 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4572 | Rev 4573 | ||
---|---|---|---|
Line 813... | Line 813... | ||
813 | Remarks: |
813 | Remarks: |
814 | * Do not rely on returned value by incorrect call, it can be |
814 | * Do not rely on returned value by incorrect call, it can be |
815 | changed in future versions of the kernel. |
815 | changed in future versions of the kernel. |
Line 816... | Line 816... | ||
816 | 816 | ||
817 | ====================================================================== |
817 | ====================================================================== |
818 | ===== Function 18, subfunction 10 - minimize application window. ===== |
818 | ======= Function 18, subfunction 10 - minimize topmost window. ======= |
819 | ====================================================================== |
819 | ====================================================================== |
820 | Minimizes the own window. |
820 | Minimizes the topmost (active) window. |
821 | Parameters: |
821 | Parameters: |
822 | * eax = 18 - function number |
822 | * eax = 18 - function number |
823 | * ebx = 10 - subfunction number |
823 | * ebx = 10 - subfunction number |
824 | Returned value: |
824 | Returned value: |
825 | * function does not return value |
825 | * function does not return value |
826 | Remarks: |
826 | Remarks: |
827 | * The minimized window from the point of view of function 9 |
827 | * The minimized window from the point of view of function 9 |
828 | keeps position and sizes. |
828 | keeps position and sizes. |
829 | * Restoring of an application window occurs at its activation by |
829 | * Restoring of an application window occurs at its activation by |
830 | subfunction 3. |
830 | subfunction 3. |
831 | * Usually there is no necessity to minimize/restire a window |
831 | * Usually there is no necessity to minimize/restore a window |
832 | obviously: minimization of a window is carried out by the system |
832 | explicitly: minimization of a window is carried out by the system |
833 | at pressing the minimization button (for skinned windows |
833 | at pressing the minimization button (for skinned windows |
834 | it is defined automatically by function 0, |
834 | it is defined automatically by function 0, |
835 | for other windows it can be defined manually by function 8), |
835 | for other windows it can be defined manually by function 8), |
Line 1237... | Line 1237... | ||
1237 | * Function does not check for correctness, as the kernel does not |
1237 | * Function does not check for correctness, as the kernel does not |
1238 | use this variable. |
1238 | use this variable. |
1239 | * To get system language use subfunction 5 of function 26. |
1239 | * To get system language use subfunction 5 of function 26. |
Line 1240... | Line 1240... | ||
1240 | 1240 | ||
1241 | ====================================================================== |
- | |
1242 | ============== Function 21, subfunction 7 - set HD base. ============= |
- | |
1243 | ====================================================================== |
- | |
1244 | The HD base defines hard disk to write with usage of obsolete |
- | |
1245 | syntax /HD in obsolete function 58; at usage of modern syntax |
- | |
1246 | /HD0,/HD1,/HD2,/HD3 base is set automatically. |
- | |
1247 | Parameters: |
- | |
1248 | * eax = 21 - function number |
- | |
1249 | * ebx = 7 - subfunction number |
- | |
1250 | * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
- | |
1251 | Returned value: |
- | |
1252 | * eax = 0 |
- | |
1253 | Remarks: |
- | |
1254 | * Any application at any time can change the base. |
- | |
1255 | * Do not change base, when any application works with hard disk. |
- | |
1256 | If you do not want system bugs. |
- | |
1257 | * To get HD base use subfunction 7 of function 26. |
- | |
1258 | * It is also necessary to define used partition of hard disk by |
- | |
1259 | subfunction 8. |
- | |
1260 | - | ||
1261 | ====================================================================== |
- | |
1262 | ========= Function 21, subfunction 8 - set used HD partition. ======== |
- | |
1263 | ====================================================================== |
- | |
1264 | The HD partition defines partition of the hard disk to write with |
- | |
1265 | usage of obsolete syntax /HD and obsolete function 58; |
- | |
1266 | at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3 |
- | |
1267 | base and partition are set automatically. |
- | |
1268 | Parameters: |
- | |
1269 | * eax = 21 - function number |
- | |
1270 | * ebx = 8 - subfunction number |
- | |
1271 | * ecx = HD partition (beginning from 1) |
- | |
1272 | Return value: |
- | |
1273 | * eax = 0 |
- | |
1274 | Remarks: |
- | |
1275 | * Any application at any time can change partition. |
- | |
1276 | * Do not change partition when any application works with hard disk. |
- | |
1277 | If you do not want system bugs. |
- | |
1278 | * To get used partition use subfunction 8 of function 26. |
- | |
1279 | * There is no correctness checks. |
- | |
1280 | * To get the number of partitions of a hard disk use |
- | |
1281 | subfunction 11 of function 18. |
- | |
1282 | * It is also necessary to define used HD base by subfunction 7. |
- | |
1283 | - | ||
1284 | ====================================================================== |
1241 | ====================================================================== |
1285 | Function 21, subfunction 11 - enable/disable low-level access to HD. |
1242 | Function 21, subfunction 11 - enable/disable low-level access to HD. |
1286 | ====================================================================== |
1243 | ====================================================================== |
1287 | Parameters: |
1244 | Parameters: |
1288 | * eax = 21 - function number |
1245 | * eax = 21 - function number |
Line 1660... | Line 1617... | ||
1660 | by the kernel itself, however application @panel draws the |
1617 | by the kernel itself, however application @panel draws the |
1661 | appropriate icon (using this function). |
1618 | appropriate icon (using this function). |
1662 | * To set system language use subfunction 5 of function 21. |
1619 | * To set system language use subfunction 5 of function 21. |
Line 1663... | Line 1620... | ||
1663 | 1620 | ||
1664 | ====================================================================== |
- | |
1665 | ============== Function 26, subfunction 7 - get HD base. ============= |
- | |
1666 | ====================================================================== |
- | |
1667 | The HD base defines hard disk to write with usage of obsolete |
- | |
1668 | syntax /HD in obsolete function 58; at usage of modern syntax |
- | |
1669 | /HD0,/HD1,/HD2,/HD3 base is set automatically. |
- | |
1670 | Parameters: |
- | |
1671 | * eax = 26 - function number |
- | |
1672 | * ebx = 7 - subfunction number |
- | |
1673 | Returned value: |
- | |
1674 | * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
- | |
1675 | Remarks: |
- | |
1676 | * Any application in any time can change HD base. |
- | |
1677 | * To set base use subfunction 7 of function 21. |
- | |
1678 | * To get used partition of hard disk use subfunction 8. |
- | |
1679 | - | ||
1680 | ====================================================================== |
- | |
1681 | ========= Function 26, subfunction 8 - get used HD partition. ======== |
- | |
1682 | ====================================================================== |
- | |
1683 | The HD partition defines partition of the hard disk to write with |
- | |
1684 | usage of obsolete syntax /HD in obsolete function 58; |
- | |
1685 | at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3 |
- | |
1686 | base and partition are set automatically. |
- | |
1687 | Parameters: |
- | |
1688 | * eax = 26 - function number |
- | |
1689 | * ebx = 8 - subfunction number |
- | |
1690 | Returned value: |
- | |
1691 | * eax = HD partition (beginning from 1) |
- | |
1692 | Remarks: |
- | |
1693 | * Any application in any time can change partition. |
- | |
1694 | * To set partition use subfunction 8 of function 21. |
- | |
1695 | * To get number of partitions on a hard disk use |
- | |
1696 | subfunction 11 of function 18. |
- | |
1697 | * To get base of used hard disk, use subfunction 7. |
- | |
1698 | - | ||
1699 | ====================================================================== |
1621 | ====================================================================== |
1700 | === Function 26, subfunction 9 - get the value of the time counter. == |
1622 | === Function 26, subfunction 9 - get the value of the time counter. == |
1701 | ====================================================================== |
1623 | ====================================================================== |
1702 | Parameters: |
1624 | Parameters: |
1703 | * eax = 26 - function number |
1625 | * eax = 26 - function number |
Line 2313... | Line 2235... | ||
2313 | ============= Function 48, subfunction 8 - set used skin. ============ |
2235 | ============= Function 48, subfunction 8 - set used skin. ============ |
2314 | ====================================================================== |
2236 | ====================================================================== |
2315 | Parameters: |
2237 | Parameters: |
2316 | * eax = 48 - function number |
2238 | * eax = 48 - function number |
2317 | * ebx = 8 - subfunction number |
2239 | * ebx = 8 - subfunction number |
2318 | * ecx = pointer to a block for function 58, in |
2240 | * ecx = pointer to filename of the skin |
2319 | which the fields of intermediate buffer and file name are filled |
- | |
2320 | Returned value: |
2241 | Returned value: |
2321 | * eax = 0 - success |
2242 | * eax = 0 - success |
2322 | * otherwise eax = file system error code; if file does not |
2243 | * otherwise eax = file system error code; if file does not |
2323 | contain valid skin, function returns error 3 |
2244 | contain valid skin, function returns error 3 |
2324 | (unknown file system). |
2245 | (unknown file system). |
Line 2525... | Line 2446... | ||
2525 | http://alpha1.dyns.net/files/PCI/bios21.pdf. |
2446 | http://alpha1.dyns.net/files/PCI/bios21.pdf. |
2526 | * If BIOS does not support this extension, its behavior is emulated |
2447 | * If BIOS does not support this extension, its behavior is emulated |
2527 | (through kernel-mode analogues of subfunctions of function 62). |
2448 | (through kernel-mode analogues of subfunctions of function 62). |
Line 2528... | Line 2449... | ||
2528 | 2449 | ||
2529 | ====================================================================== |
- | |
2530 | ================ Function 58 - work with file system. ================ |
- | |
2531 | ====================================================================== |
- | |
2532 | Parameters: |
- | |
2533 | * eax = 58 |
- | |
2534 | * ebx = pointer to the information structure |
- | |
2535 | Returned value: |
- | |
2536 | * eax = 0 - success; otherwise file system error code |
- | |
2537 | * some subfunctions return value in other registers too |
- | |
2538 | General format of the information structure: |
- | |
2539 | * +0: dword: subfunction number |
- | |
2540 | * +4: dword: number of block |
- | |
2541 | * +8: dword: size |
- | |
2542 | * +12 = +0xC: dword: pointer to data |
- | |
2543 | * +16 = +0x10: dword: pointer to a memory for system operations |
- | |
2544 | (4096 bytes) |
- | |
2545 | * +20 = +0x14: n db: ASCIIZ-string with the file name |
- | |
2546 | Specifications - in documentation on the appropriate subfunction. |
- | |
2547 | Filename is case-insensitive for latin letters, russian letters |
- | |
2548 | must be capital. |
- | |
2549 | Format of filename: |
- | |
2550 | /base/number/dir1/dir2/.../dirn/file, |
- | |
2551 | where /base/number identifies device, on which file is located: |
- | |
2552 | one of |
- | |
2553 | * /RD/1 = /RAMDISK/1 to access ramdisk |
- | |
2554 | * /FD/1 = /FLOPPYDISK/1 to access first floppy drive, |
- | |
2555 | /FD/2 = /FLOPPYDISK/2 to access second one |
- | |
2556 | * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk |
- | |
2557 | (in this case base is defined by subfunction 7 of function 21), |
- | |
2558 | x - partition number (beginning from 1) |
- | |
2559 | * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices |
- | |
2560 | IDE0 (Primary Master), IDE1 (Primary Slave), |
- | |
2561 | IDE2 (Secondary Master), IDE3 (Secondary Slave); |
- | |
2562 | x - partition number on the selected hard drive, varies from 1 |
- | |
2563 | to 255 (on each hard drive the indexing starts from 1) |
- | |
2564 | Remarks: |
- | |
2565 | * In the first two cases it is also possible to use FIRST |
- | |
2566 | instead of 1, SECOND instead of 2, but it is not recommended |
- | |
2567 | for convenience of transition to the future extensions. |
- | |
2568 | * Limitation n<=39 is imposed. |
- | |
2569 | * Names of folders and file dir1,...,dirn,file must have the |
- | |
2570 | format 8.3: name no more than 8 characters, dot, extension no |
- | |
2571 | more than 3 characters. Trailing spaces are ignored, no other |
- | |
2572 | spaces is allowed. If name occupies equally 8 characters, |
- | |
2573 | dot may be omitted (though it is not recommended to use this |
- | |
2574 | feature for convenience of transition to the future extensions). |
- | |
2575 | * This function does not support folders on ramdisk. |
- | |
2576 | Examples: |
- | |
2577 | * '/RAMDISK/FIRST/KERNEL.ASM',0 |
- | |
2578 | '/rd/1/kernel.asm',0 |
- | |
2579 | * '/HD0/1/kernel.asm',0 |
- | |
2580 | * '/hd0/1/menuet/pics/tanzania.bmp',0 |
- | |
2581 | Existing subfunctions: |
- | |
2582 | * subfunction 0 - read file/folder |
- | |
2583 | * subfunction 8 - LBA-read from device |
- | |
2584 | * subfunction 15 - get file system information |
- | |
2585 | - | ||
2586 | ====================================================================== |
- | |
2587 | =========== Function 58, subfunction 0 - read file/folder. =========== |
- | |
2588 | ====================================================================== |
- | |
2589 | Parameters: |
- | |
2590 | * eax = 58 |
- | |
2591 | * ebx = pointer to the information structure |
- | |
2592 | Format of the information structure: |
- | |
2593 | * +0: dword: 0 = subfunction number |
- | |
2594 | * +4: dword: first block to read (beginning from 0) |
- | |
2595 | * +8: dword: amount of blocks to read |
- | |
2596 | * +12 = +0xC: dword: pointer to buffer for data |
- | |
2597 | * +16 = +0x10: dword: pointer to buffer for system operations |
- | |
2598 | (4096 bytes) |
- | |
2599 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
- | |
2600 | given in the general description |
- | |
2601 | Returned value: |
- | |
2602 | * eax = 0 - success, otherwise file system error code |
- | |
2603 | * ebx = file size (in bytes) or -1=0xffffffff, if file was not found |
- | |
2604 | Remarks: |
- | |
2605 | * Block size is 512 bytes. |
- | |
2606 | * This function is obsolete, for reading files use subfunction 0 |
- | |
2607 | of function 70, for reading folders - subfunction 1 of |
- | |
2608 | function 70. |
- | |
2609 | * Function can read contents of a folder. Only FAT file system is |
- | |
2610 | supported. The format of FAT-folder is described |
- | |
2611 | in any FAT documentation. |
- | |
2612 | * Size of a folder is determined by size of FAT clusters chain. |
- | |
2613 | * If file was ended before last requested block was read, |
- | |
2614 | the function will read as many as it can, and after that return |
- | |
2615 | eax=6 (EOF). |
- | |
2616 | * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but |
- | |
2617 | in the first two cases the current implementation does not follow |
- | |
2618 | to the declared rules: |
- | |
2619 | for /rd/1: |
- | |
2620 | * if one want to read 0 blocks, function considers, |
- | |
2621 | that he requested 1; |
- | |
2622 | * if one requests more than 14 blocks or starting block is |
- | |
2623 | not less than 14, function returns eax=5 (not found) and ebx=-1; |
- | |
2624 | * size of ramdisk root folder is 14 blocks, |
- | |
2625 | 0x1C00=7168 bytes; but function returns ebx=0 |
- | |
2626 | (except of the case of previous item); |
- | |
2627 | * strangely enough, it is possible to read 14th block (which |
- | |
2628 | generally contains a garbage - I remind, the indexing begins |
- | |
2629 | from 0); |
- | |
2630 | * if some block with the number not less than 14 was requested, |
- | |
2631 | function returns eax=6(EOF); otherwise eax=0. |
- | |
2632 | For /fd/x: |
- | |
2633 | * if the start block is not less than 14, function returns |
- | |
2634 | eax=5 (not found) and ebx=0; |
- | |
2635 | * note that format of FAT12 allows floppies with the root size |
- | |
2636 | more or less than 14 blocks; |
- | |
2637 | * check for length is not performed; |
- | |
2638 | * if data was successful read, function returns |
- | |
2639 | eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1. |
- | |
2640 | * The function handles reading of special folders /,/rd,/fd,/hd[n]; |
- | |
2641 | but the result does not correspond to expected (on operations with |
- | |
2642 | normal files/folders), does not follow the declared rules, |
- | |
2643 | may be changed in future versions of the kernel and consequently |
- | |
2644 | is not described. To obtain the information about the equipment |
- | |
2645 | use subfunction 11 of function 18 or |
- | |
2646 | read corresponding folder with subfunction 1 of function 70. |
- | |
2647 | - | ||
2648 | ====================================================================== |
- | |
2649 | ========= Function 58, subfunction 8 - LBA-read from device. ========= |
- | |
2650 | ====================================================================== |
- | |
2651 | Parameters: |
- | |
2652 | * eax = 58 - function number |
- | |
2653 | * ebx = pointer to the information structure |
- | |
2654 | Format of the information structure: |
- | |
2655 | * +0: dword: 8 = subfunction number |
- | |
2656 | * +4: dword: number of block to read (beginning from 0) |
- | |
2657 | * +8: dword: ignored (set to 1) |
- | |
2658 | * +12 = +0xC: dword: pointer to buffer for data (512 bytes) |
- | |
2659 | * +16 = +0x10: dword: pointer to buffer for system operations |
- | |
2660 | (4096 bytes) |
- | |
2661 | * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of |
- | |
2662 | /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n, |
- | |
2663 | 1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3. |
- | |
2664 | Instead of digits it is allowed, though not recommended for |
- | |
2665 | convenience of transition to future extensions, to use |
- | |
2666 | 'first','second','third','fourth'. |
- | |
2667 | Returned value: |
- | |
2668 | * for device name /hd/xxx, where xxx is not in the list above: |
- | |
2669 | * eax = ebx = 1 |
- | |
2670 | * for invalid device name (except for the previous case): |
- | |
2671 | * eax = 5 |
- | |
2672 | * ebx does not change |
- | |
2673 | * if LBA-access is disabled by subfunction 11 of function 21: |
- | |
2674 | * eax = 2 |
- | |
2675 | * ebx destroyed |
- | |
2676 | * for ramdisk: attempt to read block outside ramdisk |
- | |
2677 | (18*2*80 blocks) results in |
- | |
2678 | * eax = 3 |
- | |
2679 | * ebx = 0 |
- | |
2680 | * for successful read: |
- | |
2681 | * eax = ebx = 0 |
- | |
2682 | Remarks: |
- | |
2683 | * Block size is 512 bytes; function reads one block. |
- | |
2684 | * Do not depend on returned value, it can be changed |
- | |
2685 | in future versions. |
- | |
2686 | * Function requires that LBA-access to devices is enabled by |
- | |
2687 | subfunction 11 of function 21. To check this one can use |
- | |
2688 | subfunction 11 of function 26. |
- | |
2689 | * LBA-read of floppy is not supported. |
- | |
2690 | * Function reads data on physical hard drive; if for any reason |
- | |
2691 | data of the concrete partition are required, application must |
- | |
2692 | define starting sector of this partition (either directly |
- | |
2693 | through MBR, or from the full structure returned by |
- | |
2694 | subfunction 11 of function 18). |
- | |
2695 | * Function does not check error code of hard disk, so request of |
- | |
2696 | nonexisting sector reads something (most probably it will be |
- | |
2697 | zeroes, but this is defined by device) and this is considered |
- | |
2698 | as success (eax=0). |
- | |
2699 | - | ||
2700 | ====================================================================== |
- | |
2701 | ==== Function 58, subfunction 15 - get information on file system. === |
- | |
2702 | ====================================================================== |
- | |
2703 | Parameters: |
- | |
2704 | * eax = 58 - function number |
- | |
2705 | * ebx = pointer to the information structure |
- | |
2706 | Format of the information structure: |
- | |
2707 | * +0: dword: 15 = subfunction number |
- | |
2708 | * +4: dword: ignored |
- | |
2709 | * +8: dword: ignored |
- | |
2710 | * +12 = +0xC: dword: ignored |
- | |
2711 | * +16 = +0x10: dword: ignored |
- | |
2712 | * +20 = +0x14: (only second character is checked) |
- | |
2713 | /rd=/RAMDISK or /hd=/HARDDISK |
- | |
2714 | Returned value: |
- | |
2715 | * if the second character does not belong to set {'r','R','h','H'}: |
- | |
2716 | * eax = 3 |
- | |
2717 | * ebx = ecx = dword [fileinfo] = 0 |
- | |
2718 | * for ramdisk: |
- | |
2719 | * eax = 0 (success) |
- | |
2720 | * ebx = total number of clusters = 2847 |
- | |
2721 | * ecx = number of free clusters |
- | |
2722 | * dword [fileinfo] = cluster size = 512 |
- | |
2723 | * for hard disk: base and partition are defined by subfunctions |
- | |
2724 | 7 and 8 of function 21: |
- | |
2725 | * eax = 0 (success) |
- | |
2726 | * ebx = total number of clusters |
- | |
2727 | * ecx = number of free clusters |
- | |
2728 | * dword [fileinfo] = cluster size (in bytes) |
- | |
2729 | Remarks: |
- | |
2730 | * Be not surprised to strange layout of 4th returned parameter |
- | |
2731 | - when this code was writing, at system calls application got |
- | |
2732 | only registers eax,ebx,ecx (from pushad-structure transmitted |
- | |
2733 | as argument to the system function). Now it is corrected, so, |
- | |
2734 | probably, it is meaningful to return cluster size in edx, while |
- | |
2735 | this function is not used yet. |
- | |
2736 | * There exists also subfunction 11 of function 18, |
- | |
2737 | which returns information on file system. From the full table |
- | |
2738 | of disk subsystem it is possible to deduce cluster size (there |
- | |
2739 | it is stored in sectors) and total number of clusters |
- | |
2740 | for hard disks. |
- | |
2741 | - | ||
2742 | ====================================================================== |
2450 | ====================================================================== |
2743 | ========== Function 60 - Inter Process Communication (IPC). ========== |
2451 | ========== Function 60 - Inter Process Communication (IPC). ========== |
2744 | ====================================================================== |
2452 | ====================================================================== |
2745 | IPC is used for message dispatching from one process/thread to |
2453 | IPC is used for message dispatching from one process/thread to |
2746 | another. Previously it is necessary to agree how to interpret |
2454 | another. Previously it is necessary to agree how to interpret |