Subversion Repositories Kolibri OS

Rev

Rev 185 | Rev 283 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 185 Rev 193
Line 377... Line 377...
377
    * the execution time adds of time leaving on operations itself
377
    * the execution time adds of time leaving on operations itself
378
      and idle time in waiting for interrupt (which can be got by call
378
      and idle time in waiting for interrupt (which can be got by call
379
      to subfunction 4 of function 18).
379
      to subfunction 4 of function 18).
380
  * Beginning from slot 2, the normal applications are placed.
380
  * Beginning from slot 2, the normal applications are placed.
381
  * The normal applications are placed in memory at the address
381
  * The normal applications are placed in memory at the address
382
    0x10000000 (kernel constand 'std_application_base_address').
382
    0x60400000 (kernel constant 'std_application_base_address').
383
    There is no intersection, as each process has its own page table.
383
    There is no intersection, as each process has its own page table.
384
  * At creation of the thread it is assigned the slot
384
  * At creation of the thread it is assigned the slot
385
    in the system table and identifier (Process/Thread IDentifier =
385
    in the system table and identifier (Process/Thread IDentifier =
386
    PID/TID), which do not vary with time for given thread.
386
    PID/TID), which do not vary with time for given thread.
387
    After completion of the thread its slot can be anew used
387
    After completion of the thread its slot can be anew used
Line 872... Line 872...
872
  * function does not return value
872
  * function does not return value
873
Structure of the buffer:
873
Structure of the buffer:
874
db a,b,c,d for version a.b.c.d
874
db a,b,c,d for version a.b.c.d
875
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
875
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
876
db 'name',0 - ASCIIZ-string with the name
876
db 'name',0 - ASCIIZ-string with the name
877
For Kolibri 0.6.0.0 kernel:
877
For Kolibri 0.5.8.1 kernel:
878
db 0,6,0,0
878
db 0,5,8,1
879
db 2
879
db 2
880
db 'Kolibri',0
880
db 'Kolibri',0
Line 881... Line 881...
881
 
881
 
882
======================================================================
882
======================================================================
Line 999... Line 999...
999
    its call find out current screen resolution (with function 14)
999
    its call find out current screen resolution (with function 14)
1000
    and check that the value of position is inside the limits of the
1000
    and check that the value of position is inside the limits of the
1001
    screen.
1001
    screen.
Line 1002... Line 1002...
1002
 
1002
 
-
 
1003
======================================================================
-
 
1004
======== Function 18, subfunction 20 - get information on RAM. =======
-
 
1005
======================================================================
-
 
1006
Parameters:
-
 
1007
  * eax = 18 - function number
-
 
1008
  * ebx = 20 - subfunction number
-
 
1009
  * ecx = pointer to the buffer for information (36 bytes)
-
 
1010
Returned value:
-
 
1011
  * eax = total size of existing RAM in pages
-
 
1012
    or -1 if error has occured
-
 
1013
  * buffer pointed to by ecx contains the following information:
-
 
1014
    * +0:  dword: total size of existing RAM in pages
-
 
1015
    * +4:  dword: size of free RAM in pages
-
 
1016
    * +8:  dword: number of page faults (exceptions #PF)
-
 
1017
                 in applications
-
 
1018
    * +12: dword: size of kernel heap in bytes
-
 
1019
    * +16: dword: free in kernel heap in bytes
-
 
1020
    * +20: dword: total number of memory blocks in kernel heap
-
 
1021
    * +24: dword: number of free memory blocks in kernel heap
-
 
1022
    * +28: dword: size of maximum free block in kernel heap
-
 
1023
                 (reserved)
-
 
1024
    * +32: dword: size of maximum allocated block in kernel heap
-
 
1025
                 (reserved)
-
 
1026
 
1003
======================================================================
1027
======================================================================
1004
==================== Function 20 - MIDI interface. ===================
1028
==================== Function 20 - MIDI interface. ===================
Line 1005... Line 1029...
1005
======================================================================
1029
======================================================================
1006
 
1030
 
Line 2872... Line 2896...
2872
  * '/HD0/1/kernel.asm',0
2896
  * '/HD0/1/kernel.asm',0
2873
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2897
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2874
Existing subfunctions:
2898
Existing subfunctions:
2875
  * subfunction 0 - read file/folder
2899
  * subfunction 0 - read file/folder
2876
  * subfunction 1 - rewrite file
2900
  * subfunction 1 - rewrite file
2877
  * subfunction 2 - delete file/folder
-
 
2878
  * subfunction 4 - make folder
2901
  * subfunction 4 - make folder
2879
  * subfunction 5 - rename/move file/folder
2902
  * subfunction 5 - rename/move file/folder
2880
  * subfunction 8 - LBA-read from device
2903
  * subfunction 8 - LBA-read from device
2881
  * subfunction 15 - get file system information
2904
  * subfunction 15 - get file system information
Line 2964... Line 2987...
2964
  * ebx destroyed
2987
  * ebx destroyed
2965
Remarks:
2988
Remarks:
2966
  * This function is obsolete, use subfunction 2 of function 70.
2989
  * This function is obsolete, use subfunction 2 of function 70.
Line 2967... Line 2990...
2967
 
2990
 
2968
======================================================================
-
 
2969
========== Function 58, subfunction 2 - delete file/folder. ==========
-
 
2970
======================================================================
-
 
2971
Parameters:
-
 
2972
  * eax = 58 - function number
-
 
2973
  * ebx = pointer to the information structure
-
 
2974
Format of the information structure:
-
 
2975
  * +0: dword: 2 = subfunction number
-
 
2976
  * +4: dword: ignored
-
 
2977
  * +8: dword: ignored
-
 
2978
  * +12 = +0xC: dword: ignored
-
 
2979
  * +16 = +0x10: dword: pointer to buffer for system operations
-
 
2980
    (4096 bytes)
-
 
2981
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
-
 
2982
    given in the general description
-
 
2983
Returned value:
-
 
2984
  * eax = 0 - success, otherwise file system error code
-
 
2985
  * ebx destroyed
-
 
2986
Remarks:
-
 
2987
  * By operations with a floppy one should not delete not empty
-
 
2988
    folder. The code working with hard disk deletes not empty folders
-
 
2989
    correctly (i.e. recursively with all files and nested folders).
-
 
2990
    Function 58 does not support folders on ramdisk.
-
 
2991
 
-
 
2992
======================================================================
2991
======================================================================
2993
============== Function 58, subfunction 4 - make folder. =============
2992
============== Function 58, subfunction 4 - make folder. =============
2994
======================================================================
2993
======================================================================
2995
Parameters:
2994
Parameters:
2996
  * eax = 58 - function number
2995
  * eax = 58 - function number
Line 3456... Line 3455...
3456
  * ecx = new memory size
3455
  * ecx = new memory size
3457
Returned value:
3456
Returned value:
3458
  * eax = 0 - success
3457
  * eax = 0 - success
3459
  * eax = 1 - not enough memory
3458
  * eax = 1 - not enough memory
3460
Remarks:
3459
Remarks:
3461
  * At the moment this function is a sole resource for dynamic
3460
  * There is another way to dynamically allocate/free memory -
3462
    allocation/free of application memory.
3461
    subfunctions 11, 12, 13 of function 68.
-
 
3462
  * The function cannot be used together with 68.11, 68.12, 68.13.
-
 
3463
    The function call will be ignored after creation of process heap
-
 
3464
    with function 68.11.
Line 3463... Line 3465...
3463
 
3465
 
3464
======================================================================
3466
======================================================================
3465
================== Function 66 - work with keyboard. =================
3467
================== Function 66 - work with keyboard. =================
3466
======================================================================
3468
======================================================================
Line 3664... Line 3666...
3664
    as a whole, with the instruction 'cpuid'. Otherwise processor
3666
    as a whole, with the instruction 'cpuid'. Otherwise processor
3665
    will generate other exception in the kernel, which will anyway
3667
    will generate other exception in the kernel, which will anyway
3666
    kill the thread.
3668
    kill the thread.
Line 3667... Line 3669...
3667
 
3669
 
3668
======================================================================
3670
======================================================================
3669
======= Function 68, subfunction 5 - allocate physical memory. =======
3671
======= Function 68, subfunction 11 - initialize process heap. =======
3670
======================================================================
3672
======================================================================
3671
Parameters:
3673
Parameters:
3672
  * eax = 68 - function number
3674
  * eax = 68 - function number
3673
  * ebx = 5 - subfunction number
-
 
3674
  * ecx = size (in bytes)
3675
  * ebx = 11 - subfunction number
-
 
3676
Returned value:
3675
Returned value:
3677
  * eax = 0 - failed
3676
  * eax = physical address of allocated memory
3678
  * otherwise size of created heap
3677
Remarks:
3679
Remarks:
3678
  * Normal applications must not use this function, it is intended
3680
  * The function call initializes heap, from which one can in future
3679
    for the case, when for some device it is required to place
3681
    allocate and free memory blocks with subfunctions 12 and 13.
3680
    data to the known physical address. (In effect, this function
-
 
3681
    was developed for AC97WAV.)
-
 
3682
  * The number of blocks of physical memory is limited (by constant
3682
    Heap size is equal to total amount of free application memory.
3683
    24, and this constant includes some blocks for kernel).
3683
  * The second function call from the same process results in
3684
  * To free a memory allocated by such way use
3684
    returning the size of the existing heap.
3685
    subfunction 6, to copy data there and back
-
 
Line 3686... Line 3685...
3686
    use subfunctions 7 and 8.
3685
  * After creation of the heap calls to function 64 will be ignored.
3687
 
3686
 
3688
======================================================================
3687
======================================================================
3689
========= Function 68, subfunction 6 - free physical memory. =========
3688
======== Function 68, subfunction 12 - allocate memory block. ========
3690
======================================================================
3689
======================================================================
3691
Parameters:
3690
Parameters:
3692
  * eax = 68 - function number
3691
  * eax = 68 - function number
3693
  * ebx = 6 - subfunction number
3692
  * ebx = 12 - subfunction number
3694
  * ecx = physical address of memory
3693
  * ecx = required size in bytes
3695
Returned value:
3694
Returned value:
3696
  * function does not return value
3695
  * eax = pointer to the allocated block
-
 
3696
Remarks:
3697
Remarks:
3697
  * Before this call one must initialize process heap by call to
3698
  * Normal applications must not use this function, it is intended
3698
    subfunction 11.
3699
    for the case, when for some device it is required to place
3699
  * The function allocates an integer number of pages (4 Kb) in such
3700
    data to the known physical address. (In effect, this function
-
 
Line 3701... Line 3700...
3701
    was developed for AC97WAV.)
3700
    way that the real size of allocated block is more than or equal to
3702
  * The memory must be previously allocated by subfunction 5.
3701
    requested size.
3703
 
3702
 
3704
======================================================================
3703
======================================================================
3705
===== Function 68, subfunction 7 - write data to physical memory. ====
3704
========== Function 68, subfunction 13 - free memory block. ==========
3706
======================================================================
3705
======================================================================
3707
Parameters:
-
 
3708
  * eax = 68 - function number
3706
Parameters:
3709
  * ebx = 7 - subfunction number
-
 
3710
  * ecx = physical address
3707
  * eax = 68 - function number
-
 
3708
  * ebx = 13 - subfunction number
3711
  * edx = pointer to the data (in the application)
3709
  * ecx = pointer to the memory block
3712
  * esi = size of the data (in bytes)
3710
Returned value:
3713
Returned value:
-
 
3714
  * function does not return value
-
 
3715
Remarks:
3711
  * eax = 1 - success
3716
  * Normal applications must not use this function, it is intended
-
 
3717
    for the case, when for some device it is required to place
-
 
3718
    data to the known physical address. (In effect, this function
-
 
3719
    was developed for AC97WAV.)
-
 
Line 3720... Line 3712...
3720
  * The range of physical addresses should lie inside of previously
3712
  * eax = 0 - failed
3721
    allocated by subfunction 5 block of physical memory.
3713
Remarks:
3722
  * There is no check for correctness.
3714
  * The memory block must have been allocated by subfunction 12.
3723
 
3715
 
3724
======================================================================
3716
======================================================================
3725
==== Function 68, subfunction 8 - read data from physical memory. ====
3717
======== Function 68, subfunction 14 - wait for driver notify. =======
3726
======================================================================
-
 
3727
Parameters:
3718
======================================================================
3728
  * eax = 68 - function number
-
 
3729
  * ebx = 8 - subfunction number
3719
Parameters:
-
 
3720
  * eax = 68 - function number
-
 
3721
  * ebx = 14 - subfunction number
-
 
3722
  * ecx = pointer to the buffer for information (8 bytes)
-
 
3723
Returned value:
-
 
3724
  * buffer pointed to by ecx contains the following information:
-
 
3725
    * +0: dword: constant EV_INTR = 1
-
 
3726
    * +4: dword: driver data
-
 
3727
Remarks:
-
 
3728
  * The current implementation at wait time uses "heavy" operations
-
 
3729
    of task switch.
-
 
3730
 
-
 
3731
======================================================================
-
 
3732
====== Function 68, subfunction 15 - set FPU exception handler. ======
-
 
3733
======================================================================
-
 
3734
Parameters:
-
 
3735
  * eax = 68 - function number
-
 
3736
  * ebx = 15 - subfunction number
-
 
3737
  * ecx = address of the new exception handler
-
 
3738
Returned value:
-
 
3739
  * eax = address of the old exception handler (0, if it was not set)
-
 
3740
 
-
 
3741
======================================================================
-
 
3742
============= Function 68, subfunction 16 - load driver. =============
-
 
3743
======================================================================
-
 
3744
Parameters:
-
 
3745
  * eax = 68 - function number
3730
  * ecx = physical address
3746
  * ebx = 16 - subfunction number
3731
  * edx = pointer to buffer for data (in application)
3747
  * ecx = pointer to ASCIIZ-string with driver name
3732
  * esi = size of data (in bytes)
3748
Returned value:
3733
Returned value:
3749
  * eax = 0 - failed
-
 
3750
  * otherwise eax = driver handle
-
 
3751
Remarks:
3734
  * function does not return value
3752
  * If the driver was not loaded yet, it is loaded;
-
 
3753
    if the driver was loaded yet, nothing happens.
-
 
3754
  * Driver name is case-sensitive.
-
 
3755
    Maximum length of the name is 16 characters, including
-
 
3756
    terminating null character, the rest is ignored.
-
 
3757
  * The function can load only drivers which are registered in the
-
 
3758
    system; the current implementation contains
-
 
3759
    exactly 2 such drivers:
-
 
3760
    * name SOUND, file /rd/1/unisound.obj
-
 
3761
    * name INFINITY, file /rd/1/infinity.obj
-
 
3762
 
-
 
3763
======================================================================
-
 
3764
============ Function 68, subfunction 17 - driver control. ===========
-
 
3765
======================================================================
-
 
3766
Parameters:
-
 
3767
  * eax = 68 - function number
-
 
3768
  * ebx = 17 - subfunction number
-
 
3769
  * ecx = pointer to the control structure:
-
 
3770
    * +0: dword: handle of driver
-
 
3771
    * +4: dword: code of driver function
-
 
3772
    * +8: dword: pointer to input data
-
 
3773
    * +12 = +0xC: dword: size of input data
-
 
3774
    * +16 = +0x10: dword: pointer to output data
-
 
3775
    * +20 = +0x14: dword: size of output data
3735
Remarks:
3776
Returned value:
3736
  * Normal applications must not use this function, it is intended
3777
  * eax = determined by driver
-
 
3778
Remarks:
-
 
3779
  * Function codes and the structure of input/output data
3737
    for the case, when for some device it is required to place
3780
    are defined by driver.
-
 
3781
  * Previously one must obtain driver handle by subfunction 16.
-
 
3782
 
-
 
3783
======================================================================
3738
    data to the known physical address. (In effect, this function
3784
====== Function 68, subfunction 18 - set SSE exception handler. ======
-
 
3785
======================================================================
-
 
3786
Parameters:
-
 
3787
  * eax = 68 - function number
Line 3739... Line 3788...
3739
    was developed for AC97WAV.)
3788
  * ebx = 15 - subfunction number
3740
  * The range of physical addresses should lie inside of previously
3789
  * ecx = address of the new exception handler
3741
    allocated by subfunction 5 block of physical memory.
3790
Returned value:
3742
  * There is no check for correctness.
3791
  * eax = address of the old exception handler (0, if it was not set)
3743
 
3792
 
3744
======================================================================
-
 
3745
====================== Fucntion 69 - debugging. ======================
3793
======================================================================
3746
======================================================================
3794
====================== Fucntion 69 - debugging. ======================
3747
A process can load other process as debugged by set of corresponding
3795
======================================================================
3748
bit by call to subfunction 16 of function 58
3796
A process can load other process as debugged by set of corresponding
3749
or subfunction 7 of function 70.
3797
bit by call to subfunction 7 of function 70.
Line 4039... Line 4087...
4039
  * subfunction 3 - write to existing file
4087
  * subfunction 3 - write to existing file
4040
  * subfunction 4 - set file size
4088
  * subfunction 4 - set file size
4041
  * subfunction 5 - get attributes of file/folder
4089
  * subfunction 5 - get attributes of file/folder
4042
  * subfunction 6 - set attributes of file/folder
4090
  * subfunction 6 - set attributes of file/folder
4043
  * subfunction 7 - start application
4091
  * subfunction 7 - start application
-
 
4092
  * subfunction 8 - delete file/folder
4044
For CD-drives due to hardware limitations only subfunctions
4093
For CD-drives due to hardware limitations only subfunctions
4045
0,1,5 and 7 are available, other subfunctions return error
4094
0,1,5 and 7 are available, other subfunctions return error
4046
with code 2.
4095
with code 2.
Line 4047... Line 4096...
4047
 
4096
 
Line 4347... Line 4396...
4347
    regarding what is less.
4396
    regarding what is less.
4348
  * If the process is started as debugged, it is created in
4397
  * If the process is started as debugged, it is created in
4349
    the suspended state; to run use subfunction 5 of function 69.
4398
    the suspended state; to run use subfunction 5 of function 69.
Line 4350... Line 4399...
4350
 
4399
 
-
 
4400
======================================================================
-
 
4401
========== Function 70, subfunction 8 - delete file/folder. ==========
-
 
4402
======================================================================
-
 
4403
Parameters:
-
 
4404
  * eax = 70 - function number
-
 
4405
  * ebx = pointer to the information structure
-
 
4406
Format of the information structure:
-
 
4407
  * +0: dword: 8 = subfunction number
-
 
4408
  * +4: dword: 0 (reserved)
-
 
4409
  * +8: dword: 0 (reserved)
-
 
4410
  * +12 = +0xC: dword: 0 (reserved)
-
 
4411
  * +16 = +0x10: dword: 0 (reserved)
-
 
4412
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
-
 
4413
    given in the general description
-
 
4414
    or
-
 
4415
  * +20 = +0x14: db 0
-
 
4416
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
-
 
4417
Returned value:
-
 
4418
  * eax = 0 - success, otherwise file system error code
-
 
4419
  * ebx destroyed
-
 
4420
Remarks:
-
 
4421
  * The function is not supported for CD (returns error code 2).
-
 
4422
  * The function can delete only empty folders (attempt to delete
-
 
4423
    nonempty folder results in error with code 10, "access denied").
-
 
4424
 
4351
======================================================================
4425
======================================================================
4352
========== Function 71, subfunction 1 - set window caption. ==========
4426
========== Function 71, subfunction 1 - set window caption. ==========
4353
======================================================================
4427
======================================================================
4354
Parameters:
4428
Parameters:
4355
  * eax = 71 - function number
4429
  * eax = 71 - function number