Subversion Repositories Kolibri OS

Rev

Rev 837 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 837 Rev 2971
Line 1... Line 1...
1
SYSTEM FUNCTIONS of OS Kolibri 0.7.1.0
1
SYSTEM FUNCTIONS of OS Kolibri 0.7.5.0
Line 2... Line 2...
2
 
2
 
3
Number of the function is located in the register eax.
3
Number of the function is located in the register eax.
4
The call of the system function is executed by "int 0x40" command.
4
The call of the system function is executed by "int 0x40" command.
5
All registers except explicitly declared in the returned value,
5
All registers except explicitly declared in the returned value,
Line 217... Line 217...
217
Remarks:
217
Remarks:
218
  * Passing ebx=0 does not transfer control to the next process
218
  * Passing ebx=0 does not transfer control to the next process
219
    and does not make any operations at all. If it is really required
219
    and does not make any operations at all. If it is really required
220
    to transfer control to the next process (to complete a current
220
    to transfer control to the next process (to complete a current
221
    time slice), use subfunction 1 of function 68.
221
    time slice), use subfunction 1 of function 68.
222
  * At current implementation there will be an immediate return from
-
 
223
    the function, if the addition of ebx with current value of
-
 
224
    time counter will call 32-bit overflow.
-
 
Line 225... Line 222...
225
 
222
 
226
======================================================================
223
======================================================================
227
============== Function 6 - read the file from ramdisk. ==============
224
============== Function 6 - read the file from ramdisk. ==============
228
======================================================================
225
======================================================================
Line 611... Line 608...
611
Takes away the code of the pressed button from the buffer.
608
Takes away the code of the pressed button from the buffer.
612
Parameters:
609
Parameters:
613
  * eax = 17 - function number
610
  * eax = 17 - function number
614
Returned value:
611
Returned value:
615
  * if the buffer is empty, function returns eax=1
612
  * if the buffer is empty, function returns eax=1
616
  * if the buffer is not empty, function returns:
613
  * if the buffer is not empty:
617
    high 24 bits of eax contain button identifier (in particular, ah
614
    * high 24 bits of eax contain button identifier (in particular,
618
    contains low byte of the identifier; if all buttons have
615
      ah contains low byte of the identifier; if all buttons have
619
    the identifier less than 256, ah is enough to distinguish),
616
      the identifier less than 256, ah is enough to distinguish)
620
    and al contain 0 - if used left mouse button or bit of the used another mouse button
617
    * al = 0 - the button was pressed with left mouse button
-
 
618
    * al = bit corresponding to used mouse button otherwise
621
Remarks:
619
Remarks:
622
  * "Buffer" keeps only one button, at pressing the new button the
620
  * "Buffer" keeps only one button, at pressing the new button the
623
    information about old is lost.
621
    information about old is lost.
624
  * The call of this function by an application with inactive window
622
  * The call of this function by an application with inactive window
625
    will return answer "buffer is empty".
623
    will return answer "buffer is empty".
-
 
624
  * Returned value for al corresponds to the state of mouse buttons
-
 
625
    as in subfunction 2 of function 37 at the beginning
-
 
626
    of button press, excluding lower bit, which is cleared.
Line 626... Line 627...
626
 
627
 
627
======================================================================
628
======================================================================
628
= Function 18, subfunction 2 - terminate process/thread by the slot. =
629
= Function 18, subfunction 2 - terminate process/thread by the slot. =
629
======================================================================
630
======================================================================
Line 676... Line 677...
676
  * ebx = 5 - subfunction number
677
  * ebx = 5 - subfunction number
677
Returned value:
678
Returned value:
678
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
679
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
Line 679... Line 680...
679
 
680
 
680
======================================================================
681
======================================================================
681
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
682
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
682
======================================================================
683
======================================================================
683
Parameters:
684
Parameters:
684
  * eax = 18 - function number
685
  * eax = 18 - function number
685
  * ebx = 6 - subfunction number
686
  * ebx = 6 - subfunction number
Line 729... Line 730...
729
  * ecx = 2 - number of the subsubfunction
730
  * ecx = 2 - number of the subsubfunction
730
Returned value:
731
Returned value:
731
  * function does not return value
732
  * function does not return value
Line 732... Line 733...
732
 
733
 
733
======================================================================
734
======================================================================
734
============ Function 18, subfunction 9 - system shutdown. ===========
735
== Function 18, subfunction 9 - system shutdown with the parameter. ==
735
======================================================================
736
======================================================================
736
Parameters:
737
Parameters:
737
  * eax = 18 - function number
738
  * eax = 18 - function number
738
  * ebx = 9 - subfunction number
739
  * ebx = 9 - subfunction number
Line 745... Line 746...
745
  * by correct call function always returns eax=0
746
  * by correct call function always returns eax=0
746
    as the tag of success
747
    as the tag of success
747
Remarks:
748
Remarks:
748
  * Do not rely on returned value by incorrect call, it can be
749
  * Do not rely on returned value by incorrect call, it can be
749
    changed in future versions of the kernel.
750
    changed in future versions of the kernel.
750
  * It is possible to use subfunction 1, that on the last step
-
 
751
    the user makes choice himself.
-
 
-
 
751
 
752
======================================================================
752
======================================================================
753
===== Function 18, subfunction 10 - minimize application window. =====
753
===== Function 18, subfunction 10 - minimize application window. =====
754
======================================================================
754
======================================================================
755
Minimizes the own window.
755
Minimizes the own window.
756
Parameters:
756
Parameters:
Line 759... Line 759...
759
Returned value:
759
Returned value:
760
  * function does not return value
760
  * function does not return value
761
Remarks:
761
Remarks:
762
  * The minimized window from the point of view of function 9
762
  * The minimized window from the point of view of function 9
763
    keeps position and sizes.
763
    keeps position and sizes.
764
  * Restoring of an application window occurs at its activation by 
764
  * Restoring of an application window occurs at its activation by
765
    subfunction 3.
765
    subfunction 3.
766
  * Usually there is no necessity to minimize/restire a window
766
  * Usually there is no necessity to minimize/restire a window
767
    obviously: minimization of a window is carried out by the system
767
    obviously: minimization of a window is carried out by the system
768
    at pressing the minimization button (for skinned windows
768
    at pressing the minimization button (for skinned windows
769
    it is defined automatically by function 0,
769
    it is defined automatically by function 0,
770
    for other windows it can be defined manually by function 8),
770
    for other windows it can be defined manually by function 8),
771
    restore of a window is done by the application '@panel'.
771
    restore of a window is done by the application '@panel'.
Line 772... Line 772...
772
 
772
 
773
======================================================================
773
======================================================================
774
 Function 18, subfunction 11 - get information on the disk subsystem. 
774
 Function 18, subfunction 11 - get information on the disk subsystem.
775
======================================================================
775
======================================================================
776
Parameters:
776
Parameters:
777
  * eax = 18 - function number
777
  * eax = 18 - function number
778
  * ebx = 11 - subfunction number
778
  * ebx = 11 - subfunction number
Line 1060... Line 1060...
1060
  * cl = byte for output
1060
  * cl = byte for output
1061
Returned value (is the same for both subfunctions):
1061
Returned value (is the same for both subfunctions):
1062
  * eax = 0 - success
1062
  * eax = 0 - success
1063
  * eax = 1 - base port is not defined
1063
  * eax = 1 - base port is not defined
1064
Remarks:
1064
Remarks:
1065
  * Previously the base port must be defined by 
1065
  * Previously the base port must be defined by
1066
    subfunction 1 of function 21.
1066
    subfunction 1 of function 21.
Line 1067... Line 1067...
1067
 
1067
 
1068
======================================================================
1068
======================================================================
1069
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1069
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
Line 1104... Line 1104...
1104
    if Alt is not pressed, but Shift is pressed,
1104
    if Alt is not pressed, but Shift is pressed,
1105
    the layout with Shift is used;
1105
    the layout with Shift is used;
1106
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1106
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1107
    layout is used and then from the code is subtracted 0x60;
1107
    layout is used and then from the code is subtracted 0x60;
1108
    if no control key is pressed, the normal layout is used.
1108
    if no control key is pressed, the normal layout is used.
1109
  * To get layout and country identifier use 
1109
  * To get layout and country identifier use
1110
    subfunction 2 of function 26.
1110
    subfunction 2 of function 26.
1111
  * Country identifier is global system variable, which is not used
1111
  * Country identifier is global system variable, which is not used
1112
    by the kernel itself; however the application '@panel' displays
1112
    by the kernel itself; however the application '@panel' displays
1113
    the corresponding icon.
1113
    the corresponding icon.
1114
  * The application @panel switches layouts on user request.
1114
  * The application @panel switches layouts on user request.
Line 1125... Line 1125...
1125
Remarks:
1125
Remarks:
1126
  * CD base is used by function 24.
1126
  * CD base is used by function 24.
1127
  * To get CD base use subfunction 3 of function 26.
1127
  * To get CD base use subfunction 3 of function 26.
Line 1128... Line 1128...
1128
 
1128
 
1129
======================================================================
-
 
1130
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
-
 
1131
======================================================================
-
 
1132
Removed
-
 
1133
 
-
 
1134
======================================================================
1129
======================================================================
1135
========== Function 21, subfunction 5 - set system language. =========
1130
========== Function 21, subfunction 5 - set system language. =========
1136
======================================================================
1131
======================================================================
1137
Parameters:
1132
Parameters:
1138
  * eax = 21 - function number
1133
  * eax = 21 - function number
Line 1163... Line 1158...
1163
Remarks:
1158
Remarks:
1164
  * Any application at any time can change the base.
1159
  * Any application at any time can change the base.
1165
  * Do not change base, when any application works with hard disk.
1160
  * Do not change base, when any application works with hard disk.
1166
    If you do not want system bugs.
1161
    If you do not want system bugs.
1167
  * To get HD base use subfunction 7 of function 26.
1162
  * To get HD base use subfunction 7 of function 26.
1168
  * It is also necessary to define used partition of hard disk by 
1163
  * It is also necessary to define used partition of hard disk by
1169
    subfunction 8.
1164
    subfunction 8.
Line 1170... Line 1165...
1170
 
1165
 
1171
======================================================================
1166
======================================================================
1172
========= Function 21, subfunction 8 - set used HD partition. ========
1167
========= Function 21, subfunction 8 - set used HD partition. ========
Line 1185... Line 1180...
1185
  * Any application at any time can change partition.
1180
  * Any application at any time can change partition.
1186
  * Do not change partition when any application works with hard disk.
1181
  * Do not change partition when any application works with hard disk.
1187
    If you do not want system bugs.
1182
    If you do not want system bugs.
1188
  * To get used partition use subfunction 8 of function 26.
1183
  * To get used partition use subfunction 8 of function 26.
1189
  * There is no correctness checks.
1184
  * There is no correctness checks.
1190
  * To get the number of partitions of a hard disk use 
1185
  * To get the number of partitions of a hard disk use
1191
    subfunction 11 of function 18.
1186
    subfunction 11 of function 18.
1192
  * It is also necessary to define used HD base by subfunction 7.
1187
  * It is also necessary to define used HD base by subfunction 7.
Line 1193... Line 1188...
1193
 
1188
 
1194
======================================================================
-
 
1195
======== Function 21, subfunction 10 - set sound DMA channel. ========
-
 
1196
======================================================================
-
 
1197
Removed
-
 
1198
 
-
 
1199
======================================================================
1189
======================================================================
1200
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1190
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1201
======================================================================
1191
======================================================================
1202
Parameters:
1192
Parameters:
1203
  * eax = 21 - function number
1193
  * eax = 21 - function number
1204
  * ebx = 11 - subfunction number
1194
  * ebx = 11 - subfunction number
Line 1209... Line 1199...
1209
  * Is used in LBA-read (subfunction 8 of function 58).
1199
  * Is used in LBA-read (subfunction 8 of function 58).
1210
  * The current implementation uses only low bit of ecx.
1200
  * The current implementation uses only low bit of ecx.
1211
  * To get current status use subfunction 11 of function 26.
1201
  * To get current status use subfunction 11 of function 26.
Line 1212... Line 1202...
1212
 
1202
 
1213
======================================================================
1203
======================================================================
1214
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1204
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1215
======================================================================
1205
======================================================================
1216
Parameters:
1206
Parameters:
1217
  * eax = 21 - function number
1207
  * eax = 21 - function number
1218
  * ebx = 12 - subfunction number
1208
  * ebx = 12 - subfunction number
Line 1276... Line 1266...
1276
    ebx,ecx are destroyed
1266
    ebx,ecx are destroyed
1277
  * eax = [width]*65536 + [height]
1267
  * eax = [width]*65536 + [height]
1278
  * ebx = frequency of the vertical scanning (in Hz)
1268
  * ebx = frequency of the vertical scanning (in Hz)
1279
  * ecx = number of current videomode
1269
  * ecx = number of current videomode
1280
Remarks:
1270
Remarks:
1281
  * Driver must be initialized by call to 
1271
  * Driver must be initialized by call to
1282
    driver function 1.
1272
    driver function 1.
1283
  * If only screen sizes are required, it is more expedient to use
1273
  * If only screen sizes are required, it is more expedient to use
1284
    function 14 taking into account that it
1274
    function 14 taking into account that it
1285
    returns sizes on 1 less.
1275
    returns sizes on 1 less.
Line 1411... Line 1401...
1411
    * FR = starting frame
1401
    * FR = starting frame
1412
Returned value:
1402
Returned value:
1413
  * eax = 0 - success
1403
  * eax = 0 - success
1414
  * eax = 1 - CD base is not defined
1404
  * eax = 1 - CD base is not defined
1415
Remarks:
1405
Remarks:
1416
  * Previously CD base must be defined by the call to 
1406
  * Previously CD base must be defined by the call to
1417
    subfunction 3 of function 21.
1407
    subfunction 3 of function 21.
1418
  * One second includes 75 frames, one minute includes 60 seconds.
1408
  * One second includes 75 frames, one minute includes 60 seconds.
1419
  * The function is asynchronous (returns control, when play begins).
1409
  * The function is asynchronous (returns control, when play begins).
Line 1420... Line 1410...
1420
 
1410
 
Line 1431... Line 1421...
1431
  * eax = 1 - CD base is not defined
1421
  * eax = 1 - CD base is not defined
1432
Remarks:
1422
Remarks:
1433
  * The format of the table with tracks information is the same as
1423
  * The format of the table with tracks information is the same as
1434
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1424
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1435
    Function returns addresses in MSF.
1425
    Function returns addresses in MSF.
1436
  * Previously CD base port must be set by call to 
1426
  * Previously CD base port must be set by call to
1437
    subfunction 3 of function 21.
1427
    subfunction 3 of function 21.
1438
  * Function returns information only about no more than 100
1428
  * Function returns information only about no more than 100
1439
    first tracks. In most cases it is enough.
1429
    first tracks. In most cases it is enough.
Line 1440... Line 1430...
1440
 
1430
 
Line 1446... Line 1436...
1446
  * ebx = 1 - subfunction number
1436
  * ebx = 1 - subfunction number
1447
Returned value:
1437
Returned value:
1448
  * eax = 0 - success
1438
  * eax = 0 - success
1449
  * eax = 1 - CD base is not defined
1439
  * eax = 1 - CD base is not defined
1450
Remarks:
1440
Remarks:
1451
  * Previously CD base port must be defined by call to 
1441
  * Previously CD base port must be defined by call to
1452
    subfunction 3 of function 21.
1442
    subfunction 3 of function 21.
Line 1453... Line 1443...
1453
 
1443
 
1454
======================================================================
1444
======================================================================
1455
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1445
======= Function 24, subfunction 4 - eject tray of disk drive. =======
Line 1482... Line 1472...
1482
Remarks:
1472
Remarks:
1483
  * The function is supported only for ATAPI devices (CD and DVD).
1473
  * The function is supported only for ATAPI devices (CD and DVD).
1484
  * An example of usage of the function is the application CD_tray.
1474
  * An example of usage of the function is the application CD_tray.
Line 1485... Line 1475...
1485
 
1475
 
1486
======================================================================
-
 
1487
=================== Function 25 - set SBPro volume. ==================
-
 
1488
======================================================================
-
 
1489
Removed
-
 
1490
 
-
 
1491
======================================================================
1476
======================================================================
1492
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1477
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1493
======================================================================
1478
======================================================================
1494
Parameters:
1479
Parameters:
1495
  * eax = 26 - function number
1480
  * eax = 26 - function number
Line 1526... Line 1511...
1526
    if Alt is not pressed, but Shift is pressed,
1511
    if Alt is not pressed, but Shift is pressed,
1527
    the layout with Shift is used;
1512
    the layout with Shift is used;
1528
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1513
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1529
    layout is used and then from the code is subtracted 0x60;
1514
    layout is used and then from the code is subtracted 0x60;
1530
    if no control key is pressed, the normal layout is used.
1515
    if no control key is pressed, the normal layout is used.
1531
  * To set layout and country identifier use 
1516
  * To set layout and country identifier use
1532
    subfunction 2 of function 21.
1517
    subfunction 2 of function 21.
1533
  * Country identifier is global system variable, which is not used
1518
  * Country identifier is global system variable, which is not used
1534
    by the kernel itself; however the application '@panel' displays
1519
    by the kernel itself; however the application '@panel' displays
1535
    the corresponding icon (using this function).
1520
    the corresponding icon (using this function).
1536
  * The application @panel switches layouts on user request.
1521
  * The application @panel switches layouts on user request.
Line 1546... Line 1531...
1546
Remarks:
1531
Remarks:
1547
  * CD base is used by function 24.
1532
  * CD base is used by function 24.
1548
  * To set CD base use subfunction 3 of function 21.
1533
  * To set CD base use subfunction 3 of function 21.
Line 1549... Line 1534...
1549
 
1534
 
1550
======================================================================
-
 
1551
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
-
 
1552
======================================================================
-
 
1553
Removed
-
 
1554
 
-
 
1555
======================================================================
1535
======================================================================
1556
========== Function 26, subfunction 5 - get system language. =========
1536
========== Function 26, subfunction 5 - get system language. =========
1557
======================================================================
1537
======================================================================
1558
Parameters:
1538
Parameters:
1559
  * eax = 26 - function number
1539
  * eax = 26 - function number
Line 1613... Line 1593...
1613
  * Counter takes modulo 2^32, that correspond to a little more
1593
  * Counter takes modulo 2^32, that correspond to a little more
1614
    than 497 days.
1594
    than 497 days.
1615
  * To get system time use function 3.
1595
  * To get system time use function 3.
Line 1616... Line 1596...
1616
 
1596
 
1617
======================================================================
-
 
1618
======== Function 26, subfunction 10 - get sound DMA channel. ========
-
 
1619
======================================================================
-
 
1620
Removed
-
 
1621
 
-
 
1622
======================================================================
1597
======================================================================
1623
===================== Function 26, subfunction 11 ====================
1598
===================== Function 26, subfunction 11 ====================
1624
========== Find out whether low-level HD access is enabled. ==========
1599
========== Find out whether low-level HD access is enabled. ==========
1625
======================================================================
1600
======================================================================
1626
Parameters:
1601
Parameters:
Line 1645... Line 1620...
1645
  * Is used by operations with PCI bus (function 62).
1620
  * Is used by operations with PCI bus (function 62).
1646
  * The current implementation uses only low bit of ecx.
1621
  * The current implementation uses only low bit of ecx.
1647
  * To set the current state use subfunction 12 of function 21.
1622
  * To set the current state use subfunction 12 of function 21.
Line 1648... Line 1623...
1648
 
1623
 
1649
======================================================================
-
 
1650
=================== Function 28 - set SB16 volume. ===================
-
 
1651
======================================================================
-
 
1652
Removed
-
 
1653
 
-
 
1654
======================================================================
1624
======================================================================
1655
=================== Function 29 - get system date. ===================
1625
=================== Function 29 - get system date. ===================
1656
======================================================================
1626
======================================================================
1657
Parameters:
1627
Parameters:
1658
  * eax = 29 - function number
1628
  * eax = 29 - function number
Line 1688... Line 1658...
1688
Remarks:
1658
Remarks:
1689
  * If the buffer is too small to hold all data, only first (edx-1)
1659
  * If the buffer is too small to hold all data, only first (edx-1)
1690
    bytes are copied and than terminating 0 is inserted.
1660
    bytes are copied and than terminating 0 is inserted.
Line 1691... Line 1661...
1691
 
1661
 
-
 
1662
======================================================================
-
 
1663
=============== Function 32 - delete file from ramdisk. ==============
-
 
1664
======================================================================
-
 
1665
Parameters:
-
 
1666
  * eax = 32 - function number
-
 
1667
  * ebx = pointer to the filename
-
 
1668
Returned value:
-
 
1669
  * eax = 0 - success; otherwise file system error code
-
 
1670
Remarks:
-
 
1671
  * This function is obsolete; function 58 allows to fulfill
-
 
1672
    the same operations with the extended possibilities.
-
 
1673
  * The current implementation returns only values 0(success) and
-
 
1674
    5(file not found).
-
 
1675
  * The filename must be either in the format 8+3 characters
-
 
1676
    (first 8 characters - name itself, last 3 - extension,
-
 
1677
    the short names and extensions are supplemented with spaces),
-
 
1678
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
-
 
1679
    (name no more than 8 characters, dot, extension 3 characters
-
 
1680
    supplemented if necessary by spaces).
-
 
1681
    The filename must be written with capital letters. The terminating
-
 
1682
    character with code 0 is not necessary (not ASCIIZ-string).
-
 
1683
  * This function does not support folders on the ramdisk.
-
 
1684
 
-
 
1685
======================================================================
-
 
1686
================ Function 33 - write file to ramdisk. ================
-
 
1687
======================================================================
-
 
1688
Parameters:
-
 
1689
  * eax = 33 - function number
-
 
1690
  * ebx = pointer to the filename
-
 
1691
  * ecx = pointer to data for writing
-
 
1692
  * edx = number of bytes for writing
-
 
1693
  * should be set esi=0
-
 
1694
Returned value:
-
 
1695
  * eax = 0 - success, otherwise file system error code
-
 
1696
Remarks:
-
 
1697
  * This function is obsolete; function 70 allows to fulfil
-
 
1698
    the same operations with extended possibilities.
-
 
1699
  * If esi contains non-zero value and selected file already exists,
-
 
1700
    one more file with the same name will be created.
-
 
1701
  * Otherwise file will be overwritten.
-
 
1702
  * The filename must be either in the format 8+3 characters
-
 
1703
    (first 8 characters - name itself, last 3 - extension,
-
 
1704
    the short names and extensions are supplemented with spaces),
-
 
1705
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
-
 
1706
    (name no more than 8 characters, dot, extension 3 characters
-
 
1707
    supplemented if necessary by spaces).
-
 
1708
    The filename must be written with capital letters. The terminating
-
 
1709
    character with code 0 is not necessary (not ASCIIZ-string).
-
 
1710
  * This function does not support folders on the ramdisk.
-
 
1711
 
1692
======================================================================
1712
======================================================================
1693
======= Function 35 - read the color of a pixel on the screen. =======
1713
======= Function 35 - read the color of a pixel on the screen. =======
1694
======================================================================
1714
======================================================================
1695
Parameters:
1715
Parameters:
1696
  * eax = 35
1716
  * eax = 35
Line 1705... Line 1725...
1705
  * There is also direct access (without any system calls)
1725
  * There is also direct access (without any system calls)
1706
    to videomemory through the selector gs. To get parameters of
1726
    to videomemory through the selector gs. To get parameters of
1707
    the current videomode, use function 61.
1727
    the current videomode, use function 61.
Line 1708... Line 1728...
1708
 
1728
 
-
 
1729
======================================================================
-
 
1730
=================== Function 36 - read screen area. ==================
-
 
1731
======================================================================
-
 
1732
Paramters:
-
 
1733
  * eax = 36 - function number
-
 
1734
  * ebx = pointer to the previously allocated memory area,
-
 
1735
        where will be placed the image in the format BBGGRRBBGGRR...
-
 
1736
  * ecx = [size on axis x]*65536 + [size on axis y]
-
 
1737
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
-
 
1738
Returned value:
-
 
1739
  * function does not return value
-
 
1740
Remarks:
-
 
1741
  * Coordinates of the image are coordinates of the upper left corner
-
 
1742
    of the image relative to the screen.
-
 
1743
  * Size of the image in bytes is 3*xsize*ysize.
-
 
1744
 
1709
======================================================================
1745
======================================================================
1710
=================== Function 37 - work with mouse. ===================
1746
=================== Function 37 - work with mouse. ===================
Line 1711... Line 1747...
1711
======================================================================
1747
======================================================================
1712
 
1748
 
Line 1850... Line 1886...
1850
Remarks:
1886
Remarks:
1851
  * Do not rely on returned value for invalid offsets, it may be
1887
  * Do not rely on returned value for invalid offsets, it may be
1852
    changed in future kernel versions.
1888
    changed in future kernel versions.
1853
  * Offset for pixel with coordinates (x,y)
1889
  * Offset for pixel with coordinates (x,y)
1854
    is calculated as (x+y*xsize)*3.
1890
    is calculated as (x+y*xsize)*3.
1855
  * There is a pair function to set pixel on the background image - 
1891
  * There is a pair function to set pixel on the background image -
1856
    subfunction 2 of function 15.
1892
    subfunction 2 of function 15.
Line 1857... Line 1893...
1857
 
1893
 
1858
======================================================================
1894
======================================================================
1859
== Function 39, subfunction 4 - get drawing mode for the background. =
1895
== Function 39, subfunction 4 - get drawing mode for the background. =
Line 1863... Line 1899...
1863
  * ebx = 4 - subfunction number
1899
  * ebx = 4 - subfunction number
1864
Returned value:
1900
Returned value:
1865
  * eax = 1 - tile
1901
  * eax = 1 - tile
1866
  * eax = 2 - stretch
1902
  * eax = 2 - stretch
1867
Remarks:
1903
Remarks:
1868
  * There is a pair function to set drawing mode - 
1904
  * There is a pair function to set drawing mode -
1869
    subfunction 4 of function 15.
1905
    subfunction 4 of function 15.
Line 1870... Line 1906...
1870
 
1906
 
1871
======================================================================
1907
======================================================================
1872
=========== Function 40 - set the mask for expected events. ==========
1908
=========== Function 40 - set the mask for expected events. ==========
Line 1897... Line 1933...
1897
  * eax = owner PID
1933
  * eax = owner PID
1898
  * eax = 0, if there is no owner
1934
  * eax = 0, if there is no owner
1899
  * eax = -1 for incorrect ebx
1935
  * eax = -1 for incorrect ebx
Line 1900... Line 1936...
1900
 
1936
 
1901
======================================================================
1937
======================================================================
1902
==================== Function 42 - work with IRQ data. ===============
1938
================== Function 42 - work with IRQ data. =================
1903
======================================================================
-
 
1904
 
-
 
1905
------------------------ Reading data --------------------------------
-
 
1906
 
1939
======================================================================
1907
When an IRQ occurs, the system reads data from ports indicated
1940
When an IRQ occurs, the system reads data from ports indicated
1908
earlier by function 44 and writes this data to
1941
earlier by function 44 and writes this data to
-
 
1942
internal buffer. This function reads out data from that buffer.
1909
internal buffer. This function reads out data from that buffer
1943
 
1910
to the buffer specified as parameter.
1944
--------------------- Subfunction 0 - read data ----------------------
1911
Parameters:
1945
Parameters:
1912
  * eax = 42 - function number
1946
  * eax = 42 - function number
1913
  * bl = IRQ number, 0..15
1947
  * bl = IRQ number, 0..15
1914
  * bh = subfunction number, 0
1948
  * bh = 0 - subfunction number
1915
Other part of register ebx, must be zero.
1949
  * rest of ebx must be zeroed
1916
  * ecx = pointer to the receive buffer
1950
  * ecx = pointer to a buffer with size not less than 4000 bytes
1917
Returned value: (use value of eax to distinguish)
1951
Returned value: (use value of eax to distinguish)
1918
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1952
  * if the thread is not IRQ owner
1919
    * eax = -1
1953
    (or IRQ number is incorrect): eax = -1
1920
  * if there is no data:
-
 
1921
    * eax = 0
1954
  * if there is no data: eax = 0
1922
  * if all is ok:
1955
  * if all is ok:
1923
    * eax = byte size of data, read from buffer
-
 
1924
 
-
 
1925
See remarks below.
-
 
1926
 
-
 
Line -... Line 1956...
-
 
1956
    eax = size of data read (in bytes)
1927
------------------------ Get data size -------------------------------
1957
 
1928
 
1958
------------- Subfunction 1 - get size of data in buffer -------------
1929
Parameters:
1959
Parameters:
1930
  * eax = 42 - function number
1960
  * eax = 42 - function number
1931
  * bl = IRQ number, 0..15
1961
  * bl = IRQ number, 0..15
1932
  * bh = subfunction number, 0
-
 
1933
Other part of register ebx, must be zero.
1962
  * bh = 0 - subfunction number
1934
  * ecx = pointer to receive buffer
1963
  * rest of ebx must be zeroed
1935
Returned value: (use value of eax to distinguish)
1964
Returned value:
1936
  * if the thread is not IRQ owner (or IRQ number is incorrect):
-
 
1937
    * eax = -1
1965
  * if the thread is not IRQ owner
1938
  * if all is ok:
-
 
1939
    * eax = byte size of data in buffer
1966
    (or IRQ number is incorrect): eax = -1
1940
 
1967
  * otherwise eax = size of data in buffer
1941
Remarks:
1968
Remarks:
1942
  * Previously the thread must reserve indicated IRQ for itself
1969
  * Previously the thread must reserve indicated IRQ for itself
1943
    by function 45.
1970
    by function 45.
Line 2164... Line 2191...
2164
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2191
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2165
Remarks:
2192
Remarks:
2166
  * Structure of the color table is described in the standard
2193
  * Structure of the color table is described in the standard
2167
    include file 'macros.inc' as 'system_colors'; for example,
2194
    include file 'macros.inc' as 'system_colors'; for example,
2168
    it is possible to write:
2195
    it is possible to write:
2169
    	sc	system_colors		; variable declaration
2196
        sc      system_colors           ; variable declaration
2170
    	...				; somewhere one must call
2197
        ...                             ; somewhere one must call
2171
    					; this function with ecx=sc
2198
                                        ; this function with ecx=sc
2172
    	mov	ecx, [sc.work_button_text]	; read text color on
2199
        mov     ecx, [sc.work_button_text]      ; read text color on
2173
    					; buttin in working area
2200
                                        ; buttin in working area
2174
  * A program itself desides to use or not to use color table.
2201
  * A program itself desides to use or not to use color table.
2175
    For usage program must simply at calls to drawing functions select
2202
    For usage program must simply at calls to drawing functions select
2176
    color taken from the table.
2203
    color taken from the table.
2177
  * At change of the table of standard colors (by subfunction 2 with
2204
  * At change of the table of standard colors (by subfunction 2 with
2178
    the subsequent application of changes by subfunction 0 or
2205
    the subsequent application of changes by subfunction 0 or
Line 2363... Line 2390...
2363
  * ecx = address of thread entry point (starting eip)
2390
  * ecx = address of thread entry point (starting eip)
2364
  * edx = pointer to thread stack (starting esp)
2391
  * edx = pointer to thread stack (starting esp)
2365
Returned value:
2392
Returned value:
2366
  * eax = -1 - error (there is too many threads)
2393
  * eax = -1 - error (there is too many threads)
2367
  * otherwise eax = TID - thread identifier
2394
  * otherwise eax = TID - thread identifier
2368
         
2395
    
Line 2369... Line 2396...
2369
 
2396
 
2370
======================================================================
2397
======================================================================
2371
=== Function 52, subfunction 0 - get network driver configuration. ===
2398
=== Function 52, subfunction 0 - get network driver configuration. ===
2372
======================================================================
2399
======================================================================
Line 2441... Line 2468...
2441
    (PPP, SLIP).
2468
    (PPP, SLIP).
2442
  * Data size must not exceed 1500 bytes, though function
2469
  * Data size must not exceed 1500 bytes, though function
2443
    performs no checks on correctness.
2470
    performs no checks on correctness.
Line 2444... Line 2471...
2444
 
2471
 
2445
======================================================================
2472
======================================================================
2446
 Function 52, subfunction 8 - read data from the network output queue. 
2473
 Function 52, subfunction 8 - read data from the network output queue.
2447
======================================================================
2474
======================================================================
2448
Parameters:
2475
Parameters:
2449
  * eax = 52 - function number
2476
  * eax = 52 - function number
2450
  * ebx = 8 - subfunction number
2477
  * ebx = 8 - subfunction number
Line 2560... Line 2587...
2560
Remarks:
2587
Remarks:
2561
  * The current implementation does not close automatically all
2588
  * The current implementation does not close automatically all
2562
    sockets of a thread at termination. In particular, one should not
2589
    sockets of a thread at termination. In particular, one should not
2563
    kill a thread with many opened sockets - there will be an outflow
2590
    kill a thread with many opened sockets - there will be an outflow
2564
    of resources.
2591
    of resources.
2565
  * The current implementation does no checks on correctness
-
 
2566
    (function returns error only if thread tries to close not opened
-
 
2567
    socket with correct handle).
-
 
Line 2568... Line 2592...
2568
 
2592
 
2569
======================================================================
2593
======================================================================
2570
============== Function 53, subfunction 2 - poll socket. =============
2594
============== Function 53, subfunction 2 - poll socket. =============
2571
======================================================================
2595
======================================================================
2572
Parameters:
2596
Parameters:
2573
  * eax = 53 - function number
2597
  * eax = 53 - function number
2574
  * ebx = 2 - subfunction number
2598
  * ebx = 2 - subfunction number
2575
  * ecx = socket handle
2599
  * ecx = socket handle
2576
Returned value:
2600
Returned value:
2577
  * eax = number of read bytes
2601
  * eax = number of read bytes, 0 for incorrect handle
2578
  * ebx destroyed
-
 
2579
Remarks:
-
 
Line 2580... Line 2602...
2580
  * There is no checks for correctness.
2602
  * ebx destroyed
2581
 
2603
 
2582
======================================================================
2604
======================================================================
2583
========= Function 53, subfunction 3 - read byte from socket. ========
2605
========= Function 53, subfunction 3 - read byte from socket. ========
2584
======================================================================
2606
======================================================================
2585
Parameters:
2607
Parameters:
2586
  * eax = 53 - function number
2608
  * eax = 53 - function number
2587
  * ebx = 3 - subfunction number
2609
  * ebx = 3 - subfunction number
2588
  * ecx = socket handle
2610
  * ecx = socket handle
2589
Returned value:
2611
Returned value:
2590
  * if there is no read data: eax=0, bl=0,
2612
  * if there is no read data or handle is incorrect: eax=0, bl=0,
2591
    other bytes of ebx are destroyed
2613
    other bytes of ebx are destroyed
2592
  * if there are read data: eax=number of rest bytes
-
 
2593
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
-
 
Line 2594... Line 2614...
2594
Remarks:
2614
  * if there are read data: eax=number of rest bytes
2595
  * There is no checks for correctness.
2615
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2596
 
2616
 
2597
======================================================================
2617
======================================================================
Line 2602... Line 2622...
2602
  * ebx = 4 - subfunction number
2622
  * ebx = 4 - subfunction number
2603
  * ecx = socket handle
2623
  * ecx = socket handle
2604
  * edx = number of bytes to write
2624
  * edx = number of bytes to write
2605
  * esi = pointer to data to write
2625
  * esi = pointer to data to write
2606
Returned value:
2626
Returned value:
2607
  * eax = 0xffffffff - invalid handle
2627
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2608
  * eax = 0xffff - not enough memory
-
 
2609
  * eax = 0 - success
2628
  * eax = 0 - success
2610
  * ebx destroyed
2629
  * ebx destroyed
2611
Remarks:
2630
Remarks:
2612
  * Check on validity of handle is minimal - only not very incorrect
-
 
2613
    not opened handles are eliminated.
-
 
2614
  * Number of bytes to write must not exceed 1500-28, though
2631
  * Number of bytes to write must not exceed 1500-28, though
2615
    the appropriate check is not made.
2632
    the appropriate check is not made.
Line 2616... Line 2633...
2616
 
2633
 
2617
======================================================================
2634
======================================================================
Line 2636... Line 2653...
2636
Parameters:
2653
Parameters:
2637
  * eax = 53 - function number
2654
  * eax = 53 - function number
2638
  * ebx = 6 - subfunction number
2655
  * ebx = 6 - subfunction number
2639
  * ecx = socket handle
2656
  * ecx = socket handle
2640
Returned value:
2657
Returned value:
2641
  * eax = socket status: one of
2658
  * eax = 0 for incorrect handle or socket status: one of
2642
  * TCB_LISTEN = 1
2659
  * TCB_LISTEN = 1
2643
  * TCB_SYN_SENT = 2
2660
  * TCB_SYN_SENT = 2
2644
  * TCB_SYN_RECEIVED = 3
2661
  * TCB_SYN_RECEIVED = 3
2645
  * TCB_ESTABLISHED = 4
2662
  * TCB_ESTABLISHED = 4
2646
  * TCB_FIN_WAIT_1 = 5
2663
  * TCB_FIN_WAIT_1 = 5
Line 2648... Line 2665...
2648
  * TCB_CLOSE_WAIT = 7
2665
  * TCB_CLOSE_WAIT = 7
2649
  * TCB_CLOSING = 8
2666
  * TCB_CLOSING = 8
2650
  * TCB_LAST_ASK = 9
2667
  * TCB_LAST_ASK = 9
2651
  * TCB_TIME_WAIT = 10
2668
  * TCB_TIME_WAIT = 10
2652
  * TCB_CLOSED = 11
2669
  * TCB_CLOSED = 11
2653
  * ebx destroys
2670
  * ebx destroyed
2654
Remarks:
-
 
2655
  * There is no checks for correctness.
-
 
Line 2656... Line 2671...
2656
 
2671
 
2657
======================================================================
2672
======================================================================
2658
========== Function 53, subfunction 7 - write to TCP-socket. =========
2673
========== Function 53, subfunction 7 - write to TCP-socket. =========
2659
======================================================================
2674
======================================================================
Line 2662... Line 2677...
2662
  * ebx = 7 - subfunction number
2677
  * ebx = 7 - subfunction number
2663
  * ecx = socket handle
2678
  * ecx = socket handle
2664
  * edx = number of bytes to write
2679
  * edx = number of bytes to write
2665
  * esi = pointer to data to write
2680
  * esi = pointer to data to write
2666
Returned value:
2681
Returned value:
2667
  * eax = 0xffffffff - error
-
 
2668
  * eax = 0xffff - not enough memory
2682
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2669
  * eax = 0 - success
2683
  * eax = 0 - success
2670
  * ebx destroyed
2684
  * ebx destroyed
2671
Remarks:
2685
Remarks:
2672
  * Check on validity of handle is minimal - only not very incorrect
-
 
2673
    not opened handles are eliminated.
-
 
2674
  * Number of bytes to write must not exceed 1500-40, though
2686
  * Number of bytes to write must not exceed 1500-40, though
2675
    the appropriate check is not made.
2687
    the appropriate check is not made.
Line 2676... Line 2688...
2676
 
2688
 
2677
======================================================================
2689
======================================================================
Line 2680... Line 2692...
2680
Parameters:
2692
Parameters:
2681
  * eax = 53 - function number
2693
  * eax = 53 - function number
2682
  * ebx = 8 - subfunction number
2694
  * ebx = 8 - subfunction number
2683
  * ecx = socket handle
2695
  * ecx = socket handle
2684
Returned value:
2696
Returned value:
2685
  * eax = -1 - invalid handle
2697
  * eax = -1 - error (invalid handle or
2686
  * eax = 0xffff - not enough memory for socket close packet
2698
    not enough memory for socket close packet)
2687
  * eax = 0 - success
2699
  * eax = 0 - success
2688
  * in many cases eax is destroyed (the result of function 'queue'
-
 
2689
    is returned) - probably this is bug, which will be corrected
-
 
2690
  * ebx destroyed
2700
  * ebx destroyed
2691
Remarks:
2701
Remarks:
2692
  * The current implementation does not close automatically all
2702
  * The current implementation does not close automatically all
2693
    sockets of a thread at termination. In particular, one should not
2703
    sockets of a thread at termination. In particular, one should not
2694
    kill a thread with many opened sockets - there will be an outflow
2704
    kill a thread with many opened sockets - there will be an outflow
2695
    of resources.
2705
    of resources.
2696
  * The current implementation does no checks on correctness
-
 
2697
    (function returns error only if thread tries to close not opened
-
 
2698
    socket with correct handle).
-
 
Line 2699... Line 2706...
2699
 
2706
 
2700
======================================================================
2707
======================================================================
2701
=== Function 53, subfunction 9 - check whether local port is free. ===
2708
=== Function 53, subfunction 9 - check whether local port is free. ===
2702
======================================================================
2709
======================================================================
Line 2734... Line 2741...
2734
  * ecx = socket handle
2741
  * ecx = socket handle
2735
  * edx = pointer to buffer
2742
  * edx = pointer to buffer
2736
  * esi = number of bytes to read;
2743
  * esi = number of bytes to read;
2737
  * esi = 0 - read all data (maximum 4096 bytes)
2744
  * esi = 0 - read all data (maximum 4096 bytes)
2738
Returned value:
2745
Returned value:
2739
  * eax = number of bytes read
2746
  * eax = number of bytes read (0 for incorrect handle)
2740
  * ebx destroyed
2747
  * ebx destroyed
2741
Remakrs:
-
 
2742
  * There is no check on handle correctness.
-
 
Line 2743... Line 2748...
2743
 
2748
 
2744
======================================================================
2749
======================================================================
2745
= Function 53, subfunction 255 - debug information of network driver. 
2750
= Function 53, subfunction 255 - debug information of network driver.
2746
======================================================================
2751
======================================================================
2747
Parameters:
2752
Parameters:
2748
  * eax = 53 - function number
2753
  * eax = 53 - function number
2749
  * ebx = 255 - subfunction number
2754
  * ebx = 255 - subfunction number
Line 2771... Line 2776...
2771
  * 4: total number of dumped received packets
2776
  * 4: total number of dumped received packets
2772
  * 5: total number of received ARP-packets
2777
  * 5: total number of received ARP-packets
2773
  * 6: status of packet driver, 0=inactive, nonzero=active
2778
  * 6: status of packet driver, 0=inactive, nonzero=active
Line 2774... Line 2779...
2774
 
2779
 
2775
======================================================================
-
 
2776
========== Function 55, subfunction 0 - load data for SB16. ==========
-
 
2777
======================================================================
-
 
2778
Parameters:
-
 
2779
  * eax = 55 - function number
-
 
2780
  * ebx = 0 - subfunction number
-
 
2781
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
-
 
2782
    set by subfunction 2)
-
 
2783
Returned value:
-
 
2784
  * function does not return value
-
 
2785
Remarks:
-
 
2786
  * Format and size of data are set by subfunction 2.
-
 
2787
 
-
 
2788
======================================================================
-
 
2789
======== Function 55, subfunction 1 - begin play data on SB16. =======
-
 
2790
======================================================================
-
 
2791
Parameters:
-
 
2792
  * eax = 55 - function number
-
 
2793
  * ebx = 1 - subfunction number
-
 
2794
Returned value:
-
 
2795
  * function does not return value
-
 
2796
Remarks:
-
 
2797
  * Previously data must be loaded by subfunction 0 and
-
 
2798
    their format must be defined by subfunction 2.
-
 
2799
  * Function returns control, when playing of data began; after that
-
 
2800
    play goes independently from application (and does not use
-
 
2801
    processor time at all).
-
 
2802
  * Previously must be defined SB16 base port
-
 
2803
    (by subfunction 4 of function 21) and DMA channel
-
 
2804
    (by subfunction 10 of function 21).
-
 
2805
 
-
 
2806
======================================================================
-
 
2807
======== Function 55, subfunction 2 - set format of SB16 data. =======
-
 
2808
======================================================================
-
 
2809
Parameters:
-
 
2810
  * eax = 55 - function number
-
 
2811
  * ebx = 2 - subfunction number
-
 
2812
  * ecx = 0 - set digit capacity
-
 
2813
    * edx = 1 - 8bit mono
-
 
2814
    * edx = 2 - 8bit stereo
-
 
2815
  * ecx = 1 - set data size
-
 
2816
    * edx = size in bytes
-
 
2817
  * ecx = 2 - set play frequency
-
 
2818
    * edx = frequency
-
 
2819
Returned value:
-
 
2820
  * function does not return value
-
 
2821
Remarks:
-
 
2822
  * When the system boots, it sets following default parameters:
-
 
2823
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
-
 
2824
    Nevertheless it is recommended to set necessary values obviously
-
 
2825
    as they could be reset by some application.
-
 
2826
 
-
 
2827
======================================================================
2780
======================================================================
2828
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2781
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2829
======================================================================
2782
======================================================================
2830
Parameters:
2783
Parameters:
2831
  * eax = 55 - function number
2784
  * eax = 55 - function number
2832
  * ebx = 55 - subfunction number
2785
  * ebx = 55 - subfunction number
Line 2968... Line 2921...
2968
    for /rd/1:
2921
    for /rd/1:
2969
    * if one want to read 0 blocks, function considers,
2922
    * if one want to read 0 blocks, function considers,
2970
      that he requested 1;
2923
      that he requested 1;
2971
    * if one requests more than 14 blocks or starting block is
2924
    * if one requests more than 14 blocks or starting block is
2972
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2925
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2973
    * size of ramdisk root folder is 14 blocks, 
2926
    * size of ramdisk root folder is 14 blocks,
2974
      0x1C00=7168 áàéò; but function returns ebx=0
2927
      0x1C00=7168 áàéò; but function returns ebx=0
2975
      (except of the case of previous item);
2928
      (except of the case of previous item);
2976
    * strangely enough, it is possible to read 14th block (which
2929
    * strangely enough, it is possible to read 14th block (which
2977
      generally contains a garbage - I remind, the indexing begins
2930
      generally contains a garbage - I remind, the indexing begins
2978
      from 0);
2931
      from 0);
Line 3030... Line 2983...
3030
    * eax = ebx = 0
2983
    * eax = ebx = 0
3031
Remarks:
2984
Remarks:
3032
  * Block size is 512 bytes; function reads one block.
2985
  * Block size is 512 bytes; function reads one block.
3033
  * Do not depend on returned value, it can be changed
2986
  * Do not depend on returned value, it can be changed
3034
    in future versions.
2987
    in future versions.
3035
  * Function requires that LBA-access to devices is enabled by 
2988
  * Function requires that LBA-access to devices is enabled by
3036
    subfunction 11 of function 21. To check this one can use 
2989
    subfunction 11 of function 21. To check this one can use
3037
    subfunction 11 of function 26.
2990
    subfunction 11 of function 26.
3038
  * LBA-read of floppy is not supported.
2991
  * LBA-read of floppy is not supported.
3039
  * Function reads data on physical hard drive; if for any reason
2992
  * Function reads data on physical hard drive; if for any reason
3040
    data of the concrete partition are required, application must
2993
    data of the concrete partition are required, application must
3041
    define starting sector of this partition (either directly
2994
    define starting sector of this partition (either directly
Line 3141... Line 3094...
3141
==== Function 61 - get parameters for the direct graphics access. ====
3094
==== Function 61 - get parameters for the direct graphics access. ====
3142
======================================================================
3095
======================================================================
3143
The data of the graphics screen (the memory area which displays
3096
The data of the graphics screen (the memory area which displays
3144
screen contents) are accessible to a program directly, without
3097
screen contents) are accessible to a program directly, without
3145
any system calls, through the selector gs:
3098
any system calls, through the selector gs:
3146
	mov	eax, [gs:0]
3099
        mov     eax, [gs:0]
3147
places in eax the first dword of the buffer, which contains
3100
places in eax the first dword of the buffer, which contains
3148
information on color of the left upper point (and, possibly, colors
3101
information on color of the left upper point (and, possibly, colors
3149
of several following).
3102
of several following).
3150
	mov	[gs:0], eax
3103
        mov     [gs:0], eax
3151
by work in VESA modes with LFB sets color of the left upper point
3104
by work in VESA modes with LFB sets color of the left upper point
3152
(and, possibly, colors of several following).
3105
(and, possibly, colors of several following).
3153
To interpret the data of graphics screen program needs to know
3106
To interpret the data of graphics screen program needs to know
3154
some parameters, returning by this function.
3107
some parameters, returning by this function.
3155
Remarks:
3108
Remarks:
Line 3373... Line 3326...
3373
Parameters:
3326
Parameters:
3374
  * eax = 65 - function number
3327
  * eax = 65 - function number
3375
  * ebx = pointer to the image
3328
  * ebx = pointer to the image
3376
  * ecx = [size on axis x]*65536 + [size on axis y]
3329
  * ecx = [size on axis x]*65536 + [size on axis y]
3377
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3330
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3378
  * esi = number of bits per pixel, must be 8, 24 or 32
3331
  * esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
3379
  * edi = pointer to palette (256 colors 0x00RRGGBB);
3332
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3380
          ignored when esi = 24 and 32
3333
          ignored when esi > 8
3381
  * ebp = offset of next row data relative to previous row data
3334
  * ebp = offset of next row data relative to previous row data
3382
Returned value:
3335
Returned value:
3383
  * function does not return value
3336
  * function does not return value
3384
Remarks:
3337
Remarks:
3385
  * Coordinates of the image are coordinates of the upper left corner
3338
  * Coordinates of the image are coordinates of the upper left corner
3386
    of the image relative to the window.
3339
    of the image relative to the window.
3387
  * Size of the image in bytes is xsize*ysize.
3340
  * Format of image with 1 bit per pixel: each byte of image
-
 
3341
    (possibly excluding last bytes in rows), contains information on
-
 
3342
    the color of 8 pixels, MSB corresponds to first pixel.
-
 
3343
  * Format of image with 2 bits per pixel: each byte of image
-
 
3344
    (possibly excluding last bytes in rows), contains information on
-
 
3345
    the color of 4 pixels, two MSBs correspond to first pixel.
-
 
3346
  * Format of image with 4 bits per pixel: each byte of image
-
 
3347
    excluding last bytes in rows (if width is odd) contains
-
 
3348
    information on the color of 2 pixels, high-order tetrad
-
 
3349
    corresponds to first pixel.
-
 
3350
  * Format of image with 8 bits per pixel: each byte of image is
3388
  * Each byte of image is index in the palette.
3351
    index in the palette.
3389
  * If the image uses less than 256 colors, palette size may be
3352
  * Format of image with 15 bits per pixel: the color of each pixel
-
 
3353
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3390
    less than 256 too.
3354
    each color.
-
 
3355
  * Format of image with 16 bits per pixel: the color of each pixel
-
 
3356
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
-
 
3357
  * Format of image with 24 bits per pixel: the color of each pixel
-
 
3358
    is coded as 3 bytes - sequentially blue, green, red components.
-
 
3359
  * Format of image with 32 bits per pixel: similar to 24, but
-
 
3360
    one additional ignored byte is present.
3391
  * The call to function 7 is equivalent to call to this function
3361
  * The call to function 7 is equivalent to call to this function
3392
    with esi=24, ebp=0.
3362
    with esi=24, ebp=0.
Line 3393... Line 3363...
3393
 
3363
 
3394
======================================================================
3364
======================================================================
Line 3641... Line 3611...
3641
Remarks:
3611
Remarks:
3642
  * The memory block must have been allocated by subfunction 12
3612
  * The memory block must have been allocated by subfunction 12
3643
    or subfunction 20.
3613
    or subfunction 20.
Line 3644... Line 3614...
3644
 
3614
 
3645
======================================================================
3615
======================================================================
-
 
3616
===================== Function 68, subfunction 14 ====================
3646
======== Function 68, subfunction 14 - wait for driver notify. =======
3617
====== Waiting delivering of signal from another program/driver ======
3647
======================================================================
3618
======================================================================
3648
Parameters:
3619
Parameters:
3649
  * eax = 68 - function number
3620
  * eax = 68 - function number
3650
  * ebx = 14 - subfunction number
3621
  * ebx = 14 - subfunction number
3651
  * ecx = pointer to the buffer for information (8 bytes)
3622
  * ecx = pointer to the buffer for information (24 bytes)
3652
Returned value:
3623
Returned value:
3653
  * buffer pointed to by ecx contains the following information:
3624
  * buffer pointed to by ecx contains the following information:
3654
    * +0: dword: constant EV_INTR = 1
-
 
3655
    * +4: dword: driver data
-
 
3656
Remarks:
3625
    * +0: dword: identifier for underlying data of signal
3657
  * The current implementation at wait time uses "heavy" operations
3626
    * +4: data of signal (20 bytes), format of which is defining by
Line 3658... Line 3627...
3658
    of task switch.
3627
          first dword
3659
 
3628
 
3660
======================================================================
3629
======================================================================
3661
====== Function 68, subfunction 15 - set FPU exception handler. ======
-
 
3662
======================================================================
3630
====== Function 68, subfunction 15 - set FPU exception handler. ======
3663
Parameters:
3631
======================================================================
3664
  * eax = 68 - function number
-
 
3665
  * ebx = 15 - subfunction number
-
 
3666
  * ecx = address of the new exception handler
-
 
Line 3667... Line 3632...
3667
Returned value:
3632
Deleted (in current implementation only 0 is returned).
3668
  * eax = address of the old exception handler (0, if it was not set)
3633
Using subfunctions 24, 25 is true.
3669
 
3634
 
3670
======================================================================
3635
======================================================================
Line 3697... Line 3662...
3697
    * +8: dword: pointer to input data
3662
    * +8: dword: pointer to input data
3698
    * +12 = +0xC: dword: size of input data
3663
    * +12 = +0xC: dword: size of input data
3699
    * +16 = +0x10: dword: pointer to output data
3664
    * +16 = +0x10: dword: pointer to output data
3700
    * +20 = +0x14: dword: size of output data
3665
    * +20 = +0x14: dword: size of output data
3701
Returned value:
3666
Returned value:
3702
  * eax = determined by driver
3667
  * eax =  error code
-
 
3668
      0  - successful call
-
 
3669
     -1  - any error.
-
 
3670
     -2, -3, -4, etc. reserved for kernel error codes
-
 
3671
      1, 2, 3, etc    driver specific error codes
3703
Remarks:
3672
Remarks:
3704
  * Function codes and the structure of input/output data
3673
  * Function codes and the structure of input/output data
3705
    are defined by driver.
3674
    are defined by driver.
3706
  * Previously one must obtain driver handle by subfunction 16.
3675
  * Previously one must obtain driver handle by subfunction 16.
Line 3707... Line 3676...
3707
 
3676
 
3708
======================================================================
3677
======================================================================
3709
====== Function 68, subfunction 18 - set SSE exception handler. ======
3678
====== Function 68, subfunction 18 - set SSE exception handler. ======
3710
======================================================================
-
 
3711
Parameters:
3679
======================================================================
3712
  * eax = 68 - function number
3680
Deleted (in current implementation only 0 is returned).
3713
  * ebx = 15 - subfunction number
-
 
3714
  * ecx = address of the new exception handler
-
 
3715
Returned value:
-
 
Line 3716... Line 3681...
3716
  * eax = address of the old exception handler (0, if it was not set)
3681
Using subfunctions 24, 25 is true.
3717
 
3682
 
3718
======================================================================
3683
======================================================================
3719
=============== Function 68, subfunction 19 - load DLL. ==============
3684
=============== Function 68, subfunction 19 - load DLL. ==============
Line 3752... Line 3717...
3752
  * If ecx=0, the function frees memory block at edx and returns 0.
3717
  * If ecx=0, the function frees memory block at edx and returns 0.
3753
  * The contents of the block are unchanged up to the shorter of
3718
  * The contents of the block are unchanged up to the shorter of
3754
    the new and old sizes.
3719
    the new and old sizes.
Line 3755... Line 3720...
3755
 
3720
 
-
 
3721
======================================================================
-
 
3722
====== Function 68, subfunction 24 - set new exceptions handler ======
-
 
3723
======================================================================
-
 
3724
Parameters:
-
 
3725
  * eax = 68 - function number
-
 
3726
  * ebx = 24 - subfunction number
-
 
3727
  * ecx = address of the new exception handler
-
 
3728
  * edx = the mask of processing exceptions
-
 
3729
Returned value:
-
 
3730
  * eax = address of the old exception handler (0, if it was not set)
-
 
3731
  * ebx = the old mask of exception handler
-
 
3732
Remarks:
-
 
3733
  * Bit number in mask of exceptions is correspond to exception number
-
 
3734
    by CPU-specification (Intel-PC). For example, FPU-exception have
-
 
3735
    number 16 (#MF), and SSE-exception - 19 (#XF)
-
 
3736
  * The current implementation ignore the inquiry for hook of 7
-
 
3737
    exception - system process #NM by one's own.
-
 
3738
  * User handler get exception number in stack parameter. So, correct
-
 
3739
    exit from handler is: RET 4. Return from handler is to the same
-
 
3740
    instruction, that was cause the exception
-
 
3741
  * When control is transfering to user handler, corresponding bit in
-
 
3742
    exception mask is clearing. Rising this exception in consequence
-
 
3743
    - reduce to default-handling. Exactly: terminating the application,
-
 
3744
    or suspending with debug-notify to owner.
-
 
3745
  * After completion of critical operations in user handler, it may be
-
 
3746
    rising corresponding bit in exception mask by using subfunction 25
-
 
3747
    Clearing exceptions flags in FPU and/or XMM modules - is
-
 
3748
    responsibility of user handler too.
-
 
3749
 
-
 
3750
======================================================================
-
 
3751
==== Function 68, subfunction 25 - change state of signal activity ===
-
 
3752
======================================================================
-
 
3753
Parameters:
-
 
3754
  * eax = 68 - function number
-
 
3755
  * ebx = 25 - subfunction number
-
 
3756
  * ecx = signal number
-
 
3757
  * edx = value of activity (0/1)
-
 
3758
Returned value:
-
 
3759
  * eax = value of old activity for this signal (0/1)
-
 
3760
Remarks:
-
 
3761
  * In current implementation, it is changed only exception mask for
-
 
3762
    user exception handler, wich was previously set by subfunction 24.
-
 
3763
    At that, number of signal correspond to exception number.
-
 
3764
 
3756
======================================================================
3765
======================================================================
3757
====================== Fucntion 69 - debugging. ======================
3766
====================== Fucntion 69 - debugging. ======================
3758
======================================================================
3767
======================================================================
3759
A process can load other process as debugged by set of corresponding
3768
A process can load other process as debugged by set of corresponding
3760
bit by call to subfunction 7 of function 70.
3769
bit by call to subfunction 7 of function 70.
Line 3782... Line 3791...
3782
    * process is suspended
3791
    * process is suspended
3783
When debugger terminates, all debugged processes are killed.
3792
When debugger terminates, all debugged processes are killed.
3784
If debugger does not want this, it must previously detach by
3793
If debugger does not want this, it must previously detach by
3785
subfunction 3.
3794
subfunction 3.
Line 3786... Line 3795...
3786
 
3795
 
3787
All subfunctions except 4 and 5 are applicable only to
-
 
3788
processes/threads started from the current by function 70
3796
All subfunctions are applicable only to processes/threads started
3789
with set debugging flag.
3797
from the current by function 70 with set debugging flag.
3790
Debugging of multithreaded programs is not supported yet.
3798
Debugging of multithreaded programs is not supported yet.
3791
The full list of subfunctions:
3799
The full list of subfunctions:
3792
  * subfunction 0 - define data area for debug messages
3800
  * subfunction 0 - define data area for debug messages
3793
  * subfunction 1 - get contents of registers of debugged thread
3801
  * subfunction 1 - get contents of registers of debugged thread
Line 3816... Line 3824...
3816
Remarks:
3824
Remarks:
3817
  * If the size field is negative, the buffer is considered locked
3825
  * If the size field is negative, the buffer is considered locked
3818
    and at arrival of new message the system will wait.
3826
    and at arrival of new message the system will wait.
3819
    For synchronization frame all work with the buffer by operations
3827
    For synchronization frame all work with the buffer by operations
3820
    lock/unlock
3828
    lock/unlock
3821
    	neg	[bufsize]
3829
        neg     [bufsize]
3822
  * Data in the buffer are considered as array of items with variable
3830
  * Data in the buffer are considered as array of items with variable
3823
    length - messages. Format of a message is explained in
3831
    length - messages. Format of a message is explained in
3824
    general description.
3832
    general description.
Line 3825... Line 3833...
3825
 
3833
 
Line 3882... Line 3890...
3882
  * function does not return value
3890
  * function does not return value
3883
Remarks:
3891
Remarks:
3884
  * If the process was suspended, it resumes execution.
3892
  * If the process was suspended, it resumes execution.
Line 3885... Line 3893...
3885
 
3893
 
3886
======================================================================
3894
======================================================================
3887
============= Function 69, subfunction 4 - suspend thread. ===========
3895
======== Function 69, subfunction 4 - suspend debugged thread. =======
3888
======================================================================
3896
======================================================================
3889
Parameters:
3897
Parameters:
3890
  * eax = 69 - function number
3898
  * eax = 69 - function number
3891
  * ebx = 4 - subfunction number
3899
  * ebx = 4 - subfunction number
3892
  * ecx = thread identifier
3900
  * ecx = thread identifier
3893
Returned value:
3901
Returned value:
-
 
3902
  * function does not return value
-
 
3903
Remarks:
-
 
3904
  * Process must be loaded for debugging (as is shown in
Line 3894... Line 3905...
3894
  * function does not return value
3905
    general description).
3895
 
3906
 
3896
======================================================================
3907
======================================================================
3897
============= Function 69, subfunction 5 - resume thread. ============
3908
======== Function 69, subfunction 5 - resume debugged thread. ========
3898
======================================================================
3909
======================================================================
3899
Parameters:
3910
Parameters:
3900
  * eax = 69 - function number
3911
  * eax = 69 - function number
3901
  * ebx = 5 - subfunction number
3912
  * ebx = 5 - subfunction number
3902
  * ecx = thread identifier
3913
  * ecx = thread identifier
-
 
3914
Returned value:
-
 
3915
  * function does not return value
-
 
3916
Remarks:
Line 3903... Line 3917...
3903
Returned value:
3917
  * Process must be loaded for debugging (as is shown in
3904
  * function does not return value
3918
    general description).
3905
 
3919
 
3906
======================================================================
3920
======================================================================