Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2089 → Rev 2090

/kernel/trunk/docs/sysfuncr.txt
1901,54 → 1901,8
* ”㭪樨 à ¡®âë á ᮡëâ¨ï¬¨ ãç¨â뢠îâ ¬ áªã ­  ¬®¬¥­â
¢ë§®¢  ä㭪樨,   ­¥ ­  ¬®¬¥­â ¯®áâ㯫¥­¨ï á®®¡é¥­¨ï.
 
======================================================================
================= ”ã­ªæ¨ï 41 - 㧭 âì ¢« ¤¥«ìæ  IRQ. =================
======================================================================
 à ¬¥âàë:
* eax = 41 - ­®¬¥à ä㭪樨
* ebx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = PID ¢« ¤¥«ìæ 
* eax = 0, ¥á«¨ ¢« ¤¥«ìæ  ­¥â
* eax = -1 ¤«ï ­¥ª®à४⭮£® ebx
 
======================================================================
========= ”ã­ªæ¨ï 42 - à ¡®â  á ¤ ­­ë¬¨, ¯®«ã祭­ë¬¨ ¯® IRQ. =========
======================================================================
à¨ ¢®§­¨ª­®¢¥­¨¨ IRQ á¨á⥬  ¬®¦¥â áç¨â뢠âì ¤ ­­ë¥ ¨§ 㪠§ ­­ëå
à ­¥¥ ä㭪樥© 44 ¯®à⮢ ¨ § ¯¨á뢠âì í⨠¤ ­­ë¥ ¢ ¡ãä¥à.
 
-------------------- ®¤äã­ªæ¨ï 0 - ç⥭¨¥ ¤ ­­ëå --------------------
 à ¬¥âàë:
* eax = 42 - ­®¬¥à ä㭪樨
* bl = ­®¬¥à IRQ, 0..15
* bh = 0 - ­®¬¥à ¯®¤ä㭪樨
* ®áâ «ì­ ï ç áâì ॣ¨áâà  ebx ¤®«¦­  ¡ëâì ®¡­ã«¥­ 
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à à §¬¥à®¬ ­¥ ¬¥­¥¥ 4000 ¡ ©â
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥: (á¨âã æ¨î ¬®¦­® à §«¨ç¨âì ¯® §­ ç¥­¨î eax)
* ¥á«¨ ¯®â®ª ­¥ ï¥âáï ¢« ¤¥«ì楬 IRQ
(¨«¨ ­®¬¥à IRQ § ¤ ­ ­¥¢¥à­®): eax = -1
* ¥á«¨ ¤ ­­ëå ­¥â: eax = 0
* ¥á«¨ ¢áñ ¢ ¯®à浪¥ ¨ ¤ ­­ë¥ ¡ë«¨:
eax = à §¬¥à ¤ ­­ëå, ¯à®ç¨â ­­ëå ¨§ ¡ãä¥à  (¢ ¡ ©â å)
 
------------ ®¤äã­ªæ¨ï 1 - 㧭 âì à §¬¥à ¤ ­­ëå ¢ ¡ãä¥à¥ ------------
 à ¬¥âàë:
* eax = 42 - ­®¬¥à ä㭪樨
* bl = ­®¬¥à IRQ, 0..15
* bh = 1 - ­®¬¥à ¯®¤ä㭪樨
* ®áâ «ì­ ï ç áâì ॣ¨áâà  ebx ¤®«¦­  ¡ëâì ®¡­ã«¥­ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ¯®â®ª ­¥ ï¥âáï ¢« ¤¥«ì楬 IRQ
(¨«¨ ­®¬¥à IRQ § ¤ ­ ­¥¢¥à­®): eax = -1
* ¨­ ç¥ eax = à §¬¥à ¤ ­­ëå ¢ ¡ãä¥à¥
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¯®â®ª ¤®«¦¥­ § à¥§¥à¢¨à®¢ âì ¤«ï ᥡï 㪠§ ­­ë© IRQ
ä㭪樥© 45.
*  §¬¥à ¡ãä¥à  ¤«ï ¤ ­­ëå - 4000 ¡ ©â, ¯à¨ ¯¥à¥¯®«­¥­¨¨
"ᢥ¦¨¥" ¤ ­­ë¥ ¯¥à¥áâ îâ § ¯¨á뢠âìáï ¢ ¡ãä¥à.
 
======================================================================
=================== ”ã­ªæ¨ï 43 - ¢¢®¤/¢ë¢®¤ ¢ ¯®àâ. ==================
======================================================================
 
1977,50 → 1931,8
¡ëáâ॥ ¨ ­¥áª®«ìª® ª®à®ç¥ ¨ ¯à®é¥. ˆ§ ­¥§ à¥§¥à¢¨à®¢ ­­ëå
¯®à⮢ ç¨â âì ¢áñ à ¢­® ­¥«ì§ï.
 
======================================================================
======== ”ã­ªæ¨ï 44 - ®¯à¥¤¥«¨âì ¤¥©áâ¢¨ï ¯à¨ ¯®áâ㯫¥­¨¨ IRQ. =======
======================================================================
à¨ ¢®§­¨ª­®¢¥­¨¨ IRQ á¨á⥬  ¬®¦¥â áç¨â뢠âì ¤ ­­ë¥ ¨§ 㪠§ ­­ëå í⮩
ä㭪樥© ¯®à⮢ ¨ § ¯¨á뢠âì í⨠¤ ­­ë¥ ¢ ¡ãä¥à, ®âªã¤  ¨å ¬®¦­®
¯à®ç¨â âì ä㭪樥© 42.
 à ¬¥âàë:
* eax = 44 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¬ áᨢ áâàãªâãà, ®¯¨á뢠îé¨å ¯® ®¤­®¬ã ¯®àâã:
* +0: word: 0 ®§­ ç ¥â ª®­¥æ ¬ áᨢ , ¨­ ç¥ ­®¬¥à ¯®àâ 
* +2: byte: § à¥§¥à¢¨à®¢ ­® (¨£­®à¨àã¥âáï)
* +3: byte: 1=áç¨â뢠âì ¡ ©â ¨§ í⮣® ¯®àâ , 2=áç¨â뢠âì á«®¢®
* ecx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯®â®ª ­¥ ï¥âáï ¢« ¤¥«ì楬 㪠§ ­­®£® IRQ
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¯®â®ª ¤®«¦¥­ § à¥§¥à¢¨à®¢ âì §  ᮡ®©
㪠§ë¢ ¥¬ë© IRQ ä㭪樥© 45.
* à¨­¨¬ îâáï ¢® ¢­¨¬ ­¨¥ ⮫쪮 ¯¥à¢ë¥ 16 ¯®à⮢.
* ’¥ªãé ï ॠ«¨§ æ¨ï à áᬠâਢ ¥â ­¥¯à ¢¨«ì­®¥ §­ ç¥­¨¥ ¯®«ï +3
ª ª ᨣ­ « ¯à¥ªà é¥­¨ï ®¡à ¡®âª¨ IRQ.
 
======================================================================
============ ”ã­ªæ¨ï 45 - § à¥§¥à¢¨à®¢ âì/®á¢®¡®¤¨âì IRQ. ============
======================================================================
 à ¬¥âàë:
* eax = 45 - ­®¬¥à ä㭪樨
* ebx = 0 - § à¥§¥à¢¨à®¢ âì, 1 = ®á¢®¡®¤¨âì
* ecx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ®è¨¡ª  (­¥¢¥à­ë© ­®¬¥à IRQ ¨«¨
¯®¯ë⪠ § à¥§¥à¢¨à®¢ âì ­¥á¢®¡®¤­ë© IRQ ¨«¨ ®á¢®¡®¤¨âì IRQ, ­¥
§ à¥§¥à¢¨à®¢ ­­ë© ⥪ã騬 ¯®â®ª®¬)
‡ ¬¥ç ­¨ï:
* ¥§¥à¢¨à®¢ ­¨¥ IRQ ­ã¦­® ¤«ï à ¡®âë ä㭪権 42 ¨ 44.
* ’®«ìª® ®¤¨­ ¯®â®ª ¬®¦¥â § à¥§¥à¢¨à®¢ âì ª®­ªà¥â­ë© IRQ.
* IRQ, ®¡à ¡ â뢠¥¬ë¥ á¨á⥬®© á ¬®áâ®ï⥫쭮, १¥à¢¨àãîâáï
á¨á⥬®© (¯®â®ª®¬ 1) ¯à¨ § £à㧪¥.
* à¨ § ¢¥à襭¨¨ ¯®â®ª   ¢â®¬ â¨ç¥áª¨ ®á¢®¡®¦¤ îâáï
¢á¥ § à¥§¥à¢¨à®¢ ­­ë¥ ¨¬ IRQ.
 
======================================================================
= ”ã­ªæ¨ï 46 - § à¥§¥à¢¨à®¢ âì/®á¢®¡®¤¨âì £à㯯㠯®à⮢ ¢¢®¤ /¢ë¢®¤ .
======================================================================
Š § à¥§¥à¢¨à®¢ ­­ë¬ ¯®àâ ¬ ¬®¦­® ®¡à é âìáï ­ ¯àï¬ãî ¨§ ¯à¨«®¦¥­¨ï
/kernel/trunk/docs/sysfuncs.txt
1877,55 → 1877,8
* Event functions take into account the mask on moment of
function call, not on moment of event arrival.
 
======================================================================
==================== Function 41 - get IRQ owner. ====================
======================================================================
Parameters:
* eax = 41 - function number
* ebx = IRQ number, 0..15
Returned value:
* eax = owner PID
* eax = 0, if there is no owner
* eax = -1 for incorrect ebx
 
======================================================================
================== Function 42 - work with IRQ data. =================
======================================================================
When an IRQ occurs, the system reads data from ports indicated
earlier by function 44 and writes this data to
internal buffer. This function reads out data from that buffer.
 
--------------------- Subfunction 0 - read data ----------------------
Parameters:
* eax = 42 - function number
* bl = IRQ number, 0..15
* bh = 0 - subfunction number
* rest of ebx must be zeroed
* ecx = pointer to a buffer with size not less than 4000 bytes
Returned value: (use value of eax to distinguish)
* if the thread is not IRQ owner
(or IRQ number is incorrect): eax = -1
* if there is no data: eax = 0
* if all is ok:
eax = size of data read (in bytes)
 
------------- Subfunction 1 - get size of data in buffer -------------
Parameters:
* eax = 42 - function number
* bl = IRQ number, 0..15
* bh = 0 - subfunction number
* rest of ebx must be zeroed
Returned value:
* if the thread is not IRQ owner
(or IRQ number is incorrect): eax = -1
* otherwise eax = size of data in buffer
Remarks:
* Previously the thread must reserve indicated IRQ for itself
by function 45.
* The size of data buffer is 4000 bytes, on overflow
"fresh" data cease to be written in the buffer.
 
======================================================================
================ Function 43 - input/output to a port. ===============
======================================================================
 
1953,50 → 1906,8
processor instructions in/out - this is much
faster and a bit shorter and easier.
 
======================================================================
=========== Function 44 - define operations at IRQ arrival. ==========
======================================================================
At IRQ arrival the system can read the data from ports defined
by this function and write these data to internal buffer, whence
they can be read by ôóíêöèåé 42.
Parameters:
* eax = 44 - function number
* ebx = pointer to the array of structures each describing one port:
* +0: word: 0 means end of array, otherwise port number
* +2: byte: reserved (ignored)
* +3: byte: 1=read byte from this port, 2=read word
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - success
* eax = 1 - the thread is not owner of selected IRQ
Remarks:
* Previously the thread must reserve for itself selected IRQ
by function 45.
* First 16 ports are considered only.
* The current implementation considers incorrect value of field +3
as a signal to terminate IRQ processing.
 
======================================================================
=================== Function 45 - reserve/free IRQ. ==================
======================================================================
Parameters:
* eax = 45 - function number
* ebx = 0 - reserve, 1 = free
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - success
* eax = 1 - error (invalid IRQ number
or attempt to reserve not free IRQ
or to free IRQ, not reserved by this thread)
Remarks:
* IRQ reservation is required for functions 42 and 44.
* Only one thread can reserve the specific IRQ.
* IRQs, handled by the system itself, are reserved by the system
(thread 1) at booting.
* When a thread terminates, all reserved by it IRQs
are freed automatically.
 
======================================================================
====== Function 46 - reserve/free a group of input/output ports. =====
======================================================================
To work with reserved ports an application can access directly by