From e1ffb37233ae39f99973cb98e719a00a6c101b75 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Thu, 25 Jul 2013 10:36:08 +0000 Subject: [PATCH] Update documentation for night build git-svn-id: svn://kolibrios.org@3835 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/eng/docs/OPENDIAL.TXT | 26 ++ data/it/docs/OPENDIAL.TXT | 26 ++ data/it/docs/STACK.TXT | 482 +++++++--------------- data/rus/docs/OPENDIAL.TXT | 26 ++ data/rus/docs/STACK.TXT | 203 +++++++++ data/rus/docs/STACK_RU.TXT | 378 ----------------- data/sp/docs/OPENDIAL.TXT | 26 ++ data/sp/docs/STACK.TXT | 482 +++++++--------------- kernel/trunk/docs/sysfuncr.txt | 385 ----------------- kernel/trunk/docs/sysfuncs.txt | 402 ------------------ programs/system/docpack/trunk/docpack.asm | 4 +- 11 files changed, 607 insertions(+), 1833 deletions(-) create mode 100644 data/eng/docs/OPENDIAL.TXT create mode 100644 data/it/docs/OPENDIAL.TXT create mode 100644 data/rus/docs/OPENDIAL.TXT create mode 100644 data/rus/docs/STACK.TXT delete mode 100644 data/rus/docs/STACK_RU.TXT create mode 100644 data/sp/docs/OPENDIAL.TXT diff --git a/data/eng/docs/OPENDIAL.TXT b/data/eng/docs/OPENDIAL.TXT new file mode 100644 index 0000000000..af1337b956 --- /dev/null +++ b/data/eng/docs/OPENDIAL.TXT @@ -0,0 +1,26 @@ +OpenDialog - file open dialog: +1) Move the cursor inside the panel: + a) up and down arrows (including add. keyb.) - move the cursor one position up or down. + b) PageUp - list page up. + c) PageDown - list page down. + d) Home - move to the top of directory. + e) End - move to the end of directory. +2) Enter - operations with the selected file: + a) enter the folder. + b) choose a file. +3) Using the menu: + Alt+F1 - call disk selection menu. + Alt+F2 - call sort menu. + Alt+F3 - call filter menu. + Inside the menu: + Arrow cursor up and down - move to item. + Esc - close the window. + Enter - close the window with confirmation. + Arrow cursor left and right - move into the adjacent menu. +4) Ctrl+R - update the contents of a directory. +5) Backspace - exit from the directory. +6) Insert - highlighted by red color the file at the cursor and move the cursor one position down. +7) Ctrl+A and Ctrl+(NumPad(+) Up) - select all files and directories in the active panel, with the exception of the directory '..' +8) Ctrl+(NumPad(-) Up) - deselect all files and directories in the active panel with the exception of the directory '..' +9) Ctrl+(NumPad(*) Up) - invert the selection of all files and directories in the active panel, with the exception of the directory '..' +10) Esc - shutdown the program, without opening of a file. diff --git a/data/it/docs/OPENDIAL.TXT b/data/it/docs/OPENDIAL.TXT new file mode 100644 index 0000000000..af1337b956 --- /dev/null +++ b/data/it/docs/OPENDIAL.TXT @@ -0,0 +1,26 @@ +OpenDialog - file open dialog: +1) Move the cursor inside the panel: + a) up and down arrows (including add. keyb.) - move the cursor one position up or down. + b) PageUp - list page up. + c) PageDown - list page down. + d) Home - move to the top of directory. + e) End - move to the end of directory. +2) Enter - operations with the selected file: + a) enter the folder. + b) choose a file. +3) Using the menu: + Alt+F1 - call disk selection menu. + Alt+F2 - call sort menu. + Alt+F3 - call filter menu. + Inside the menu: + Arrow cursor up and down - move to item. + Esc - close the window. + Enter - close the window with confirmation. + Arrow cursor left and right - move into the adjacent menu. +4) Ctrl+R - update the contents of a directory. +5) Backspace - exit from the directory. +6) Insert - highlighted by red color the file at the cursor and move the cursor one position down. +7) Ctrl+A and Ctrl+(NumPad(+) Up) - select all files and directories in the active panel, with the exception of the directory '..' +8) Ctrl+(NumPad(-) Up) - deselect all files and directories in the active panel with the exception of the directory '..' +9) Ctrl+(NumPad(*) Up) - invert the selection of all files and directories in the active panel, with the exception of the directory '..' +10) Esc - shutdown the program, without opening of a file. diff --git a/data/it/docs/STACK.TXT b/data/it/docs/STACK.TXT index 1d342b97fa..645f6ef488 100644 --- a/data/it/docs/STACK.TXT +++ b/data/it/docs/STACK.TXT @@ -1,387 +1,203 @@ -Cosaè implementato -================== +eax = 74 - Work directly with network interface +ebx = -1 (Get number of active network devices) -Le seguenti feature sono presenti nel codice stack TCP/IP: + out: + eax = number of active network devices - IP layer. - ICMP. - TCP layer. - UDP layer. - local loopback. - Realtek 8029 PCI ethernet interface. - Realtek 8139 PCI ethernet interface. - Intel i8255x PCI ethernet interface. - Dynamic ARP table. - PPP dialer +bh = device number, for all following functions ! -E sono implementate le seguenti applicazioni: +bl = 0 (Get device type) - Server HTTP - Telnet - Client POP - DNS Name resolver - Server MP3 - Client TFTP - Client IRC + out: + eax = device type number -Vi sono inoltre applicazioni sperimentali, per los terming di musica e -per la comunicazione via socket, in fase di sviluppo vi è anche un -browser web. +bl = 1 (Get device name) + in: + ecx = pointer to 64 byte buffer + out: + name is copied into the buffer + eax = -1 on error -Cosa non è implementato -======================= +bl = 2 (Reset the device) -Il layer IP non processa le opzioni dello header. -Il layer IP non supporta il routing. -Non è supportata la 'Packet fragmentation'. + in + none + out + eax = -1 on error +bl = 3 (Stop device) -Come configurare Kolibri per il PPP -=================================== + in + none + out + eax = -1 on error -Vedi ppp.txt +TO BE FIGURED OUT +eax = 75 - Work with Sockets -Come configurare Kolibri per l'Ethernet -======================================= +These functions work like the ones found in UNIX (and windows) +for more info, please read http://beej.us/guide/bgnet/ -Inanzitutto è necessario possedere una scheda ethernet supportata e -installata, o presente sulla scheda madre. Se non si è certi del tipo di -hardware, si può provare a configurare lo stack. Se l'hardware è -supportato allora verrà notificato e configurato correttamente. +bl = 0 (Open Socket) -Setting Up the ARP Table ------------------------- + in: + ecx = domain + edx = type + esi = protocol + out: + eax = socket number, -1 on error -Kolibri's ARP table is dynamically created and maintained; You can see what -hosts Kolibri has communicated with by running the ARPSTAT application. +bl = 1 (Close Socket) -Enabling Ethernet ------------------ + in: + ecx = socket number + out: + eax = -1 on error -Boot Kolibri, then select STACKCFG from the NET menu. -Press the 'Read' Button, then select 'Packet Driver'. -Press 'Change' next to the IP address, and enter the IP address you want -to use. Make sure it is on the same sub-net as the LAN to which you are -connected. -Press 'Apply' to action the changes. -Close the program. +bl = 2 (Bind) + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error -The stack is now running, which you can test by pinging Kolibri from a -remote host. +bl = 3 (Listen) + in: + ecx = socket number + edx = backlog + out: + eax = -1 on error -The simplest way to connect two PC's together is using a 'Null Modem' -Ethernet cable. These simply cross certain wires over. They can be -purchased from PC stores, but are simple to make. Details can be found -on the web. Look on google for 'ethernet cross over cable' or similar. +bl = 4 (connect) + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error -How to use TCP/IP locally, with no Network -========================================== +bl = 5 (accept) -Kolibri supports a form of local loopback that means applications on the -same PC can communicate with each other via sockets as though they -were on separate hosts. To connect to an application on the same machine, -specify the local IP address as the destination address. You do not even -need to configure the stack for ethernet; local loopback will work without -any network hardware. It's great for development and testing. + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = socket number, -1 on error +bl = 6 (send) -Application Programming Interface -================================= + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = -1 on error -The developer can access the stack through interrupt 0x40, function 53. -The file TFTPC.ASM gives a good example of how to use the programming -interface ( at least, for UDP), but as network communication is complex -I'll give an overview. +bl = 7 (receive) + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = number of bytes copied, -1 on error -Sockets -======= +bl = 8 (set socket options) -Applications connect to each other and pass information between themselves -through a mechanism called a 'socket'. Sockets are end-points for -communication; You need one at each application to communicate. + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer -Using sockets is a little like using files on an OS; You open them, read -and write to them, then close them. The only thing that makes life slightly -more complicated is that unlike with a file, you have something intelligent -at the other end ( which for example may not want to close when you do! ) +The buffer's first dword is the length of the buffer, minus the first dword offcourse -Lets deal with the terminology before we go any further. + out: + eax = -1 on error -socket A unique identifier used by the application for communication. -local port A number that identifies this application on the local host. - Ports are a way to allow multiple applications to communicate - with other hosts without the data becoming mixed up. ( The - technical term is 'multiplex' ). Port numbers are 16 bit. -remote port A number that identifies the application on the remote host - to which we are communicating with. To the remote host, this is - it's 'local port'. Port numbers are 16 bit. -IP Address A 32 bit number that identifies the remote host PC that we are - communicating with. -Passive Refers to the mode by which a socket is opened; When opening in - passive mode, the local PC is awaiting an incoming connection. -Active Refers to the mode by which a socket is opened; When opening in - active mode, the local PC will attempt to connect to a remote - PC. +bl = 9 (get socket options -When you connect to a socket on a remote PC, you need to specify more than -just the IP address, otherwise the remote stack will not know to which -application it should send your data. You must fully qualify the address, -which means you specify the IP address and the port number. This would be -written like this + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer -192.168.1.10:80 ; Connect to port 80 on the machine 192.168.1.10 +The buffer's first dword is the length of the buffer, minus the first dword offcourse -Port numbers are important. Some are 'well known' and provide access to -common applications. For example port 80 is used by HTTP servers; That -way I can connect to a webserver on a host without having to find out -what port number the application is listening on. + out: + eax = -1 on error, socket option otherwise -This brings me to the way in which you open a socket; As I said earlier, -there are two modes, Passive and Active. A webserver would open a passive -socket, as it is waiting for incoming connection requests. A web browser -would open an active socket because it is attempting to connect to a -specified remote host. +TIP +when you import 'network.inc' and 'macros.inc' into your source code, you can use the following syntax to work with sockets: -Access to programming interface -=============================== -The developer accesses the stack functions through interrupt 0x40, -function 53. Some functions may be accessed through function 52, but these -are mainly for stack configuration. -Here is a summary of the functions that you may use and the parameter -definitions. +for example, to open a socket -Get Local IP Address --------------------- -eax = 52 -ebx = 1 +mcall socket, AF_INET, SOCK_DGRAM,0 +mov [socketnum], eax -IP address returned in eax ( in internet byte order ) +then to connect to a server +mcall connect, [socketnum], sockaddr, 18 -Write to stack input queue --------------------------- -eax = 52 -ebx = 6 -edx = number of bytes to write -esi = pointer to data ( in application space ) -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. -This interface is for slow network drivers only ( PPP, SLIP ) +eax = 76 - Work with protocols +high half of ebx = protocol number (for all subfunctions!) +bh = device number (for all subfunctions!) +bl = subfunction number, depends on protocol type -Read data from network output queue ------------------------------------ -eax = 52 -ebx = 8 -esi = pointer to data ( in application space ) +For Ethernet protocol -On return, eax holds number of bytes transferred. -This interface is for slow network drivers only ( PPP, SLIP ) +0 - Read # Packets send +1 - Read # Packets received +2 - Read # Bytes send +3 - Read # Bytes received +4 - Read MAC +5 - Write MAC +6 - Read IN-QUEUE size +7 - Read OUT-QUEUE size +For IPv4 protocol +0 - Read # IP packets send +1 - Read # IP packets received +2 - Read IP +3 - Write IP +4 - Read DNS +5 - Write DNS +6 - Read subnet +7 - Write subnet +8 - Read gateway +9 - Write gateway +For ARP protocol -Open a UDP socket ------------------ -eax = 53 -ebx = 0 -ecx = local port -edx = remote port -esi = remote ip address ( in internet byte order ) +0 - Read # ARP packets send +1 - Read # ARP packets received +2 - Get # ARP entry's +3 - Read ARP entry +4 - Add static ARP entry +5 - Remove ARP entry (-1 = remove all) +For ICMP protocol -The socket number allocated is returned in eax. -A return value of 0xFFFFFFFF means no socket could be opened. +0 - Read # ICMP packets send +1 - Read # ICMP packets received +3 - enable/disable ICMP echo reply +For UDP protocol +0 - Read # UDP packets send +1 - Read # UDP packets received +For TCP protocol -Open a TCP socket ------------------ -eax = 53 -ebx = 5 -ecx = local port -edx = remote port -esi = remote ip address ( in internet byte order ) -edi = mode : SOCKET_PASSIVE or SOCKET_ACTIVE ( defined in stack.inc ) - -The socket number allocated is returned in eax. -A return value of 0xFFFFFFFF means no socket could be opened. - - -Close a socket (UDP Only ) --------------------------- -eax = 53 -ebx = 1 -ecx = socket number - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Close a socket (TCP Only ) --------------------------- -eax = 53 -ebx = 8 -ecx = socket number - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Poll socket ------------ -eax = 53 -ebx = 2 -ecx = socket number - -On return, eax holds the number of bytes in the receive buffer. - - -Read socket data ----------------- -eax = 53 -ebx = 3 -ecx = socket number - -On return, eax holds the number of bytes remaining, bl holds a data byte. - - -Write to socket ( UDP only ) ----------------------------- -eax = 53 -ebx = 4 -ecx = socket number -edx = number of bytes to write -esi = pointer to data ( in application space ) - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Return socket status ( TCP only ) ---------------------------------- -eax = 53 -ebx = 6 -ecx = socket number - -On return, eax holds the sockets TCP status. -This function can be used to determine when a socket has actually connected -to another socket - data cannot be written to a socket until the connection -is established (TCB_ESTABLISHED). The states a socket can be in are defined -in stack.inc as TCB_ - - -Write to socket ( TCP only ) ----------------------------- -eax = 53 -ebx = 7 -ecx = socket number -edx = number of bytes to write -esi = pointer to data ( in application space ) - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Check port number ------------------ -eax = 53 -ebx = 9 -ecx = port number - -This function is used to determine if a port number -is in use by any sockets as a local port number. Local -port numbers are normally unique. - -On return, eax is 1 for port number not in use, 0 otherwise. - - -Opening a TCP socket in Kolibri -=============================== - -There are two ways to open a socket - Passive or Active. - -In a Passive connection your application 'listens' for incoming -requests from remote applications. Typically this will be done when -you are implementing a server application that allows any other -application to connect to it. You would specify a 'known' local -port number, such as 80 for a web server. You would leave the -remote IP and remote port number as 0, which indicates any -remote application may connect. - -Once the socket has been opened you would wait for an incoming -connection before doing anything. This can be by either checking -the socket status for TCB_ESTABLISHED, or waiting for data in the -receive buffer. - -In an Active connection, you are making a connection to a specified -remote port. The remote IP and remote port parameters must be filled -in with non-zero values ( otherwise, what are you connecting to? ). -You also specify a unique local port number so the remote application -can uniquely identify you - after all, there may be several applications -on your machine connected to the same remote host. See below for finding -a unique port number. - - -How to find an unused local port number -======================================= - -Typically when you are creating an active connection to a remote -socket you will want to choose a unique local port number. Local -port numbers normally start from 1000; The following code may -be used to obtain an unused port number prior to making the -open socket call. - - mov ecx, 1000 ; local port starting at 1000 - -getlp: - inc ecx - push ecx - mov eax, 53 - mov ebx, 9 - int 0x40 - pop ecx - cmp eax, 0 ; is this local port in use? - jz getlp ; yes - so try next - - ; ecx contains a free local port number - - - -Writing data to a socket -======================== - -There are two functions available depending on whether the socket -was opened for TCP or UDP protocol; The call parameters are the -same however. When the socket is being opened for TCP, use the -status function to poll for a connection - data cannot be written -to a socket until another socket has connected to it, and the -state of the socket is TCB_ESTABLISHED. - -When you write data, the call results in a single IP packet being -created and transmitted. Thus the user application is responsible for -the size of transmitted packets. Keep the packet sizes under 768 bytes. -If you are writing a terminal program like telnet, you may want to send -a packet for each keystroke ( inefficient ) or use a timer to send data -periodically ( say, every second ). - - -Reading data from a socket -========================== - -There is one function to read data from a sockets receive buffer. This -function retrieves one byte at a time. You can use the poll function to -test the receive buffer for data. - - -Closing a socket -================ - -Simply call the appropriate function - there is one for TCP, and another -for UDP. When closing a TCP socket, don't forget that the other end -may continue to send data, so the socket may remain active for a -few seconds after your call. - - -If you have any questions or have suggestions for improving this -document please contact me at mikeh@oceanfree.net. +0 - Read # TCP packets send +1 - Read # TCP packets received \ No newline at end of file diff --git a/data/rus/docs/OPENDIAL.TXT b/data/rus/docs/OPENDIAL.TXT new file mode 100644 index 0000000000..b1ff71ff42 --- /dev/null +++ b/data/rus/docs/OPENDIAL.TXT @@ -0,0 +1,26 @@ +OpenDialog - 䠩: +1) ६饭 : + ) ५ ( ⮬ ᫥ ᯮ ⥫쭮 ) - ६饭 . + ) PageUp - ࠭筮 ⠭ . + ) PageDown - ࠭筮 ⠭ . + ) Home - 砫 ⠫ 䠩. + ) End - ⠫ 䠩. +2) Enter - ⢨ 䠩 樨 ண 室 뤥: + ) 室 . + ) 롮 䠩. +3) : + Alt+F1 - 맮 롮 ᪠. + Alt+F2 - 맮 ஢. + Alt+F3 - 맮 䨫樨. + : + ५ ६饭 㭪⠬. + Esc - . + Enter - ⢥ত 㭪. + ५ ࠢ ६饭 ᥤ . +4) Ctrl+R - ᮤন ४ਨ. +5) Backspace (५ 冷 Insert) - 室 ४ਨ. +6) Insert - 뤥 梥⮬ 䠩 ஬ 室 ६饭 1 . +7) Ctrl+A Ctrl+(NumPad(+) Up) - 뤥 䠩 ४਩ ⨢ , ᪫祭 ४ਨ '..' +8) Ctrl+(NumPad(-) Up) - 뤥 䠩 ४਩ ⨢ , ᪫祭 ४ਨ '..' +9) Ctrl+(NumPad(*) Up) - ஢ 뤥 䠩 ४਩ ⨢ , ᪫祭 ४ਨ '..' +10) Esc - 襭 ࠡ ணࠬ, 䠩. diff --git a/data/rus/docs/STACK.TXT b/data/rus/docs/STACK.TXT new file mode 100644 index 0000000000..645f6ef488 --- /dev/null +++ b/data/rus/docs/STACK.TXT @@ -0,0 +1,203 @@ +eax = 74 - Work directly with network interface +ebx = -1 (Get number of active network devices) + + out: + eax = number of active network devices + +bh = device number, for all following functions ! + +bl = 0 (Get device type) + + out: + eax = device type number + +bl = 1 (Get device name) + + in: + ecx = pointer to 64 byte buffer + out: + name is copied into the buffer + eax = -1 on error + +bl = 2 (Reset the device) + + in + none + out + eax = -1 on error + +bl = 3 (Stop device) + + in + none + out + eax = -1 on error + +TO BE FIGURED OUT + +eax = 75 - Work with Sockets + +These functions work like the ones found in UNIX (and windows) +for more info, please read http://beej.us/guide/bgnet/ + +bl = 0 (Open Socket) + + in: + ecx = domain + edx = type + esi = protocol + out: + eax = socket number, -1 on error + +bl = 1 (Close Socket) + + in: + ecx = socket number + out: + eax = -1 on error + +bl = 2 (Bind) + + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error + +bl = 3 (Listen) + + in: + ecx = socket number + edx = backlog + out: + eax = -1 on error + +bl = 4 (connect) + + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error + +bl = 5 (accept) + + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = socket number, -1 on error + +bl = 6 (send) + + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = -1 on error + +bl = 7 (receive) + + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = number of bytes copied, -1 on error + +bl = 8 (set socket options) + + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer + +The buffer's first dword is the length of the buffer, minus the first dword offcourse + + out: + eax = -1 on error + +bl = 9 (get socket options + + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer + +The buffer's first dword is the length of the buffer, minus the first dword offcourse + + out: + eax = -1 on error, socket option otherwise + +TIP + +when you import 'network.inc' and 'macros.inc' into your source code, you can use the following syntax to work with sockets: + + +for example, to open a socket + +mcall socket, AF_INET, SOCK_DGRAM,0 +mov [socketnum], eax + +then to connect to a server + +mcall connect, [socketnum], sockaddr, 18 + + +eax = 76 - Work with protocols + +high half of ebx = protocol number (for all subfunctions!) +bh = device number (for all subfunctions!) +bl = subfunction number, depends on protocol type + +For Ethernet protocol + +0 - Read # Packets send +1 - Read # Packets received +2 - Read # Bytes send +3 - Read # Bytes received +4 - Read MAC +5 - Write MAC +6 - Read IN-QUEUE size +7 - Read OUT-QUEUE size +For IPv4 protocol + +0 - Read # IP packets send +1 - Read # IP packets received +2 - Read IP +3 - Write IP +4 - Read DNS +5 - Write DNS +6 - Read subnet +7 - Write subnet +8 - Read gateway +9 - Write gateway +For ARP protocol + +0 - Read # ARP packets send +1 - Read # ARP packets received +2 - Get # ARP entry's +3 - Read ARP entry +4 - Add static ARP entry +5 - Remove ARP entry (-1 = remove all) +For ICMP protocol + +0 - Read # ICMP packets send +1 - Read # ICMP packets received +3 - enable/disable ICMP echo reply +For UDP protocol + +0 - Read # UDP packets send +1 - Read # UDP packets received +For TCP protocol + +0 - Read # TCP packets send +1 - Read # TCP packets received \ No newline at end of file diff --git a/data/rus/docs/STACK_RU.TXT b/data/rus/docs/STACK_RU.TXT deleted file mode 100644 index 06b004a72d..0000000000 --- a/data/rus/docs/STACK_RU.TXT +++ /dev/null @@ -1,378 +0,0 @@ - ⢫ -================== - -騥 ᮡ TCP/IP ⥪: - - - ஢ IP. - ICMP. - ஢ TCP. - ஢ UDP. - 横. - Realtek 8029 䥩ᮢ ⠭ Ethernet PCI. - Realtek 8139 䥩ᮢ ⠭ Ethernet PCI. - Intel i8255x PCI 䥩 ⠭ Ethernet. - ᪠ ⠡ ⮪ । ᮢ. - Point-to-point ⮪(PPP) - - ᫥騥 ୥ ணࠬ: - - HTTP ࢥ - POP - Telnet - DNS Name resolver - Mp3 ࢥ - TFTP - IRC - FTP - PPP - - - ᯥਬ⠫ ਫ ந뢠 ⮪ 모 -믮 ⢨ ᮢ १ ᮪. ⥭쪨 -㧥, 騩 ᥬ୮ ⨭(WWW). - - - ⢫ -=================== - -஢ IP ࠡ뢠 樨 . -஢ IP ন ⨧. -ࠣ ন. - - -䨣 PPP -=========================== - - ppp.txt( ppp_rus.txt ᪨ ॢ) - - - ᪮䨣஢ 쭮 -============================================== - - 砫 ⥢ ⠭ Ethernet , ᫨ , -஥ ⥬ . ᫨ , , ⥢ -, ஡ ᪮䨣஢ ⥪. ᫨ ন, -ᬮ ᯮ짮 . - -⠭ ⠡ ⮪ । ᮢ ------------------------------------------------ - - ⮪ । ᮢ 㦥 ᪨ ᮧ -᪮䨣஢. ᬮ, ࠬ ࠡ⠥, -믮 ਫ ARPSTAT. - -祭 쭮 ---------------------------- - -㧨 , ⥬ 롥 STACKCFG(䨣 ⥪) NET(). - - '⥭', ⥬ 롥 'ࠩ '. - "Change"(롮) 冷 ᮬ IP, 㦭 IP, - ᯮ짮. ⮢, 室 ⮩ ᠬ , - ᠬ 쭠 , ன 祭. "Apply"(ਬ) - ⢥ত . -ன ணࠬ. - -⥪ ᪮䨣஢ 饭. ஢ ࠡ, ய - 㤠 . - - ⮩ ᯮᮡ PC - ᯮ짮 㫥 - ᮥ. 筮 ᮥ ஢ ।⢮ . - 㯫 ᤥ. ஡ - ୥. ᪮, (ਬ www.gogle.ru) ப -᪠: '࣠ ᮥ ஢ ' . - - ᯮ짮 TCP/IP 祭 -============================================= - - ন 쭮 横, , -ਫ ⮬ ᠬ PC 㣮 १ -᮪, ᫨ 室 㤠 . ⮡ ᮥ - ਫ 쭮 設, । IP -祭. 䨣஢ ⥪ ⠭ Ethernet, - 横 㤥 ࠡ ⥢, ।. - 室 ஢ન ⫠ ⥢ ਫ. - -ਪ ணࠬ 䥩 -================================ - -ࠡ稪 ⥪ १ 뢠 0x40, 㭪樨 53. -TFTPC.ASM - 訩 ਬ ⮣, ᯮ짮 ணࠬ 䥩 -( ࠩ , UDP), ⥢ 㭨, 쭮 ᫮. -⪨ . - - -======= - -ਫ ᮥ 㣮 । ଠ ᮡ १ -堭, '᮪⮬'. - 窨 㭨樨. - 㦭 ⥢ ਫ ᮪. - -ᯮ짮 ᮪⮢ 室 ᯮ짮 䠩 . -뢠, ⠥ , ⥬ 뢠. ⢥ , - ᫮ - , ⫨稥 ࠡ -䠩,  㤭 ࠡ⮩ ᮪⮢ (ਬ, -뢠) - - ନ ०, 祬 . - -* 䨪, ᯮ㥬 ਫ -㭨樨. - -* ᫮, ஥ 㦭 ਫ -쭮 . - ᯮᮡ, ⢠ ਫ - 㣨 ࠬ, 祬 ⠭ । - (孨᪮ । '⨯'). ᫮ - 16 . - -* ᫮, ஥ ਫ 㤠񭭮 -, ஬ 頥. 㤠񭭮 - ' -'. ᫮ - 16 . - -* IP 32 ⭮ ᫮, ஥ 㤠 PC, - 頥. - -*ᨢ ० ०, ஬ ᮪ , PC -ᮥ. - -*⨢ ० ०, ஬ ᮪ , PC ⠥ -ᮥ 㤠 PC. - - ᮪⮬ 㤠 PC, ⮫쪮 । IP , - ஢ , .. । IP ᫮ . - ⥪ 㤠񭭮 PC 㤥 , ਫ । -᫠ . 让 ਬ: - -192.168.1.10:80 ; ᮥ塞 IP ᮬ 192.168.1.10 -80 . - -᫠  묨. '' ᯥ稢 -騬 ਫ. ਬ, 80 ᯮ ࢥࠬ ⥪⮢ -࠭ᯮ⭮ ⮪(HTTP). ᮥ ࢥ஬ -㦭 室 㧭 訢 ਫ -. - - , ०: ᨢ ⨢. ࢥ -ᨢ ᮪, ᪮ 室 ᮢ 祭. -Web-㧥 ⨢ ᮪, ⮬ ⠥ ᮥ -㪠 㤠 ஬. - - ணࠬ஢ 䥩 -==================================== -ࠡ稪 頥 㭪 ⥪ १ 뢠 0x40, 㭪樨 53. - 㭪 १ 㭪 52, ࠧ -।祭 䨣樨 ⥪. - 㭪権, ᯮ짮: - -砥 IP ---------------------------- -eax = 52 -ebx = 1 - -IP ⨫ eax ( ⮢, ⮨ ୥ ) - - ᯮ ⥪ 室 । ------------------------------------------------ -eax = 52 -ebx = 6 -edx = ᫮ ⮢ -esi = 㪠⥫ ( ਪ ࠭⢥) - - 饭, eax ᮤন 0, ᫨ OK, 0xFFFFFFFF, ᫨ 訡. - 䥩 - ⮫쪮 ⥢ ࠩ஢ (PPP, SLIP) - -⥭ ⥢ । 뢮 ---------------------------------------- -eax = 52 -ebx = 8 -esi = 㪠⥫ ( ਪ ࠭⢥) - - 饭, eax ⠥ ᫮ ⮢ ।. - 䥩 - ⮫쪮 ⥢ ࠩ஢ (PPP, SLIP) - -뢠 UDP ᮪ -------------------- -eax = 53 -ebx = 0 -ecx = -edx = 㤠 -esi = 㤠 ip ( ⮢, ⮨ ୥ ) - - ᮪ eax. -頥 祭 0xFFFFFFFF 砥, ᮪ 뫨. - -뢠 TCP ᮪ -------------------- -eax = 53 -ebx = 5 -ecx = -edx = 㤠 -esi = 㤠 ip ( ⮢, ⮨ ୥ ) -edi = ०: SOCKET_PASSIVE SOCKET_ACTIVE (। stack.inc) - - ᮪ 頥 eax. -頥 祭 0xFFFFFFFF 砥, ᮪ 뫨. - -⨥ ᮪ (쪮 UDP) ----------------------------- -eax = 53 -ebx = 1 -ecx = ᮪ - - 饭, eax ᮤন 0, ᫨ OK, 0xFFFFFFFF, ᫨ 訡. - -⨥ ᮪ (쪮 TCP) ----------------------------- -eax = 53 -ebx = 8 -ecx = ᫮ ᮪ - - 饭, eax ᮤন 0, ᫨ OK, 0xFFFFFFFF, ᫨ 訡. - - ᮪ -------------- -eax = 53 -ebx = 2 -ecx = ᮪ - - 饭, eax ࠭ ᫮ ⮢ 񭭮 . - -⥭ ᮪ ----------------------- -eax = 53 -ebx = 3 -ecx = ᫮ ᮪ - - 饭, eax ᮤন ᫮ ࠭ , bl ᮤন . - - ᮪ (쪮 UDP) ---------------------------- -eax = 53 -ebx = 4 -ecx = ᫮ ᮪ -edx = ᫮ ⮢ -esi = 㪠⥫ ( ਪ ࠭⢥) - - 饭, eax ᮤন 0, ᫨ OK, 0xFFFFFFFF, ᫨ 訡. - -饭 ﭨ ᮪ (쪮 TCP) ------------------------------------------ -eax = 53 -ebx = 6 -ecx = ᮪ - - 饭, eax ᮤন ﭨ TCP ᮪⮢. - - 㭪 ᯮ짮, ⮡ ।, ᮪ 䠪᪨ -ᮥ 㣨 ᮪⮬. , ᠭ ᮪, - 祭 ⠭ (TCB_ESTABLISHED). ﭨ ᮪⮢ । - 䠩 stack.inc, TCB_ - - ᮪ (쪮 TCP) ---------------------------- -eax = 53 -ebx = 7 -ecx = ᮪ -edx = ᫮ , 㦭 -esi = 㪠⥫ ( ਪ ࠭⢥) - - 饭, eax ᮤন 0, ᫨ OK, 0xFFFFFFFF, ᫨ 訡. - -஢ઠ ---------------------- -eax = 53 -ebx = 9 -ecx = - - 㭪 ᯮ, ⮡ ।, ᯮ -- ᮪⠬. 筮 㭨. - - 饭, eax = - 1 , ᯮ, -頥 0. - - -⨥ TCP ᮪ -============================= - - ᯮᮡ ᮪ - ᨢ ⨢. - - ᨢ 祭, ਫ '蠥' 室騥 㤠 -ਫ. 筮 , ⢫ - ࢥ. -  㣮 ਫ ᮥ . ⮣ 㦭 -। '' 쭮 (80 -ࢥ), ⠢ -㤠 IP 㤠 ࠢ 0(㪠뢠,  㤠 -ਫ ᮥ). - - ⮫쪮 ᮪ 㤥 , ਤ 室饣 祭 । -믮 祣 - . ஢મ ﭨ ࠧꥬ -TCB_ESTABLISHED 饬 . - - ⨢ 祭 ᮥ 㪠 㤠 ⮬. -IP 㤠 ࠬ ॢ 㫥 祭ﬨ -(, 祬 ᮥ?). , । 㭨 쭮 -, ⠪ ⮡ 㤠 ਫ 㦭 ணࠬ ⠭ - ᮥ. , ᪮쪮 ணࠬ 襩 設, -祭 ⮬ 㤠񭭮 . - ᠭ, 㭨 . - - 室 ᯮ짮 쭮 -==================================================== - - ⨢ 祭 㤠 ᮪⮬,  - 㭨 쭮 . 筮, 쭮 - 稭 1000. 騩 ᯮ짮, ⮡ -ᯮ짮 ᮧ ᮪. - - mov ecx, 1000 ; ।塞 , 稭 1000 - -getlp: - inc ecx - push ecx - mov eax, 53 - mov ebx, 9 - int 0x40 - pop ecx - cmp eax, 0 ; ᯮ? - jz getlp ; - த ॡ - - ; ecx ᮤন ᢮ 쭮 - - - - ᮪ -===================== - - 㭪樨, 騥 ⮣, ࠧꥬ ⮪ TCP -UDP. ࠬ - ᠬ 뫮. ᮪ 뢠 - TCP, ᯮ 㭪 ﭨ, ⮡ 祭 - - । ᮪, 㣮 ᮥ ⨬. ﭨ -᮪ - TCB_ESTABLISHED. - - 뫠 , ந室 ᮧ ࠢ IP . - , 짮⥫᪮ ਫ ⢥砥 ࠧ । -⮢. ࠭ 祬 768 ⮢ ࠧ . ᫨ -祭 ணࠬ (⠪, telnet), ࠢ - (䥪⨢) ⨥ . ᯮ짮 ⠩, ⮡ -ࠢ ਮ᪨ (᪠, ᥪ㭤). - -⥭ ᮪ -======================= - - 㭪 ⥭ ᮪, . -㭪 ६ ⠭ . ᯮ짮 㭪 -, ⮡ ஢ 騩 . - -⨥ ᮪ -================ - - 맮 ᮮ⢥ 㭪 ( TCP UDP, ᮮ⢥⢥). -뢠 TCP ᮪, , 㣮 ᮥ, ᮪ -த ࠢ , ⠪ ⨢ 祭 ᪮쪨 -ᥪ㭤 ᫥ 襣 . - - - -᫨ । 襭 ⮣ 㬥, -諨 쬮 mikeh@oceanfree.net. -ॢ 㬥 Hex. -᫨ । ᮤঠ, 졠 -mestack@yandex.ru : http://meos.sysbin.com diff --git a/data/sp/docs/OPENDIAL.TXT b/data/sp/docs/OPENDIAL.TXT new file mode 100644 index 0000000000..af1337b956 --- /dev/null +++ b/data/sp/docs/OPENDIAL.TXT @@ -0,0 +1,26 @@ +OpenDialog - file open dialog: +1) Move the cursor inside the panel: + a) up and down arrows (including add. keyb.) - move the cursor one position up or down. + b) PageUp - list page up. + c) PageDown - list page down. + d) Home - move to the top of directory. + e) End - move to the end of directory. +2) Enter - operations with the selected file: + a) enter the folder. + b) choose a file. +3) Using the menu: + Alt+F1 - call disk selection menu. + Alt+F2 - call sort menu. + Alt+F3 - call filter menu. + Inside the menu: + Arrow cursor up and down - move to item. + Esc - close the window. + Enter - close the window with confirmation. + Arrow cursor left and right - move into the adjacent menu. +4) Ctrl+R - update the contents of a directory. +5) Backspace - exit from the directory. +6) Insert - highlighted by red color the file at the cursor and move the cursor one position down. +7) Ctrl+A and Ctrl+(NumPad(+) Up) - select all files and directories in the active panel, with the exception of the directory '..' +8) Ctrl+(NumPad(-) Up) - deselect all files and directories in the active panel with the exception of the directory '..' +9) Ctrl+(NumPad(*) Up) - invert the selection of all files and directories in the active panel, with the exception of the directory '..' +10) Esc - shutdown the program, without opening of a file. diff --git a/data/sp/docs/STACK.TXT b/data/sp/docs/STACK.TXT index 9b2f1c7184..645f6ef488 100644 --- a/data/sp/docs/STACK.TXT +++ b/data/sp/docs/STACK.TXT @@ -1,387 +1,203 @@ -What is implemented -=================== +eax = 74 - Work directly with network interface +ebx = -1 (Get number of active network devices) -The following features are present in the TCP/IP stack code: + out: + eax = number of active network devices - IP layer. - ICMP. - TCP layer. - UDP layer. - local loopback. - Realtek 8029 PCI ethernet interface. - Realtek 8139 PCI ethernet interface. - Intel i8255x PCI ethernet interface. - Dynamic ARP table. - PPP dialer - -And the following internet applcations are implemented +bh = device number, for all following functions ! - HTTP Server - Telnet - POP Client - DNS Name resolver - MP3 Server - TFTP Client - IRC Client - -There are also a number of experimental applications for streaming music -and performing interprocess communication via sockets. A Web broswer is in -development +bl = 0 (Get device type) + out: + eax = device type number -What is not implemented -======================= +bl = 1 (Get device name) -The IP layer does not process header options. -The IP layer does not support routing. -Packet fragmentation is not supported. + in: + ecx = pointer to 64 byte buffer + out: + name is copied into the buffer + eax = -1 on error +bl = 2 (Reset the device) -How to configure Kolibri for PPP -=============================== + in + none + out + eax = -1 on error -See ppp.txt +bl = 3 (Stop device) + in + none + out + eax = -1 on error -How to configure Kolibri for Ethernet -==================================== - -First, you need to have a supported ethernet card fitted, or present -on your motherboard. If you are uncertain what type of hardware you -have, try to configue the stack. If you have supported hardware it -will be found, and enabled. +TO BE FIGURED OUT -Setting Up the ARP Table ------------------------- - -Kolibri's ARP table is dynamically created and maintained; You can see what -hosts Kolibri has communicated with by running the ARPSTAT application. +eax = 75 - Work with Sockets -Enabling Ethernet ------------------ +These functions work like the ones found in UNIX (and windows) +for more info, please read http://beej.us/guide/bgnet/ -Boot Kolibri, then select STACKCFG from the NET menu. -Press the 'Read' Button, then select 'Packet Driver'. -Press 'Change' next to the IP address, and enter the IP address you want -to use. Make sure it is on the same sub-net as the LAN to which you are -connected. -Press 'Apply' to action the changes. -Close the program. +bl = 0 (Open Socket) + in: + ecx = domain + edx = type + esi = protocol + out: + eax = socket number, -1 on error -The stack is now running, which you can test by pinging Kolibri from a -remote host. +bl = 1 (Close Socket) + in: + ecx = socket number + out: + eax = -1 on error -The simplest way to connect two PC's together is using a 'Null Modem' -Ethernet cable. These simply cross certain wires over. They can be -purchased from PC stores, but are simple to make. Details can be found -on the web. Look on google for 'ethernet cross over cable' or similar. +bl = 2 (Bind) + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error -How to use TCP/IP locally, with no Network -========================================== +bl = 3 (Listen) -Kolibri supports a form of local loopback that means applications on the -same PC can communicate with each other via sockets as though they -were on separate hosts. To connect to an application on the same machine, -specify the local IP address as the destination address. You do not even -need to configure the stack for ethernet; local loopback will work without -any network hardware. It's great for development and testing. + in: + ecx = socket number + edx = backlog + out: + eax = -1 on error +bl = 4 (connect) -Application Programming Interface -================================= + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = -1 on error -The developer can access the stack through interrupt 0x40, function 53. -The file TFTPC.ASM gives a good example of how to use the programming -interface ( at least, for UDP), but as network communication is complex -I'll give an overview. +bl = 5 (accept) + in: + ecx = socket number + edx = pointer to sockaddr structure + esi = length of sockaddr structure + out: + eax = socket number, -1 on error -Sockets -======= +bl = 6 (send) -Applications connect to each other and pass information between themselves -through a mechanism called a 'socket'. Sockets are end-points for -communication; You need one at each application to communicate. + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = -1 on error -Using sockets is a little like using files on an OS; You open them, read -and write to them, then close them. The only thing that makes life slightly -more complicated is that unlike with a file, you have something intelligent -at the other end ( which for example may not want to close when you do! ) +bl = 7 (receive) -Lets deal with the terminology before we go any further. + in: + ecx = socket number + edx = pointer to buffer + esi = length of buffer + edi = flags + out: + eax = number of bytes copied, -1 on error -socket A unique identifier used by the application for communication. -local port A number that identifies this application on the local host. - Ports are a way to allow multiple applications to communicate - with other hosts without the data becoming mixed up. ( The - technical term is 'multiplex' ). Port numbers are 16 bit. -remote port A number that identifies the application on the remote host - to which we are communicating with. To the remote host, this is - it's 'local port'. Port numbers are 16 bit. -IP Address A 32 bit number that identifies the remote host PC that we are - communicating with. -Passive Refers to the mode by which a socket is opened; When opening in - passive mode, the local PC is awaiting an incoming connection. -Active Refers to the mode by which a socket is opened; When opening in - active mode, the local PC will attempt to connect to a remote - PC. +bl = 8 (set socket options) -When you connect to a socket on a remote PC, you need to specify more than -just the IP address, otherwise the remote stack will not know to which -application it should send your data. You must fully qualify the address, -which means you specify the IP address and the port number. This would be -written like this + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer -192.168.1.10:80 ; Connect to port 80 on the machine 192.168.1.10 +The buffer's first dword is the length of the buffer, minus the first dword offcourse -Port numbers are important. Some are 'well known' and provide access to -common applications. For example port 80 is used by HTTP servers; That -way I can connect to a webserver on a host without having to find out -what port number the application is listening on. + out: + eax = -1 on error -This brings me to the way in which you open a socket; As I said earlier, -there are two modes, Passive and Active. A webserver would open a passive -socket, as it is waiting for incoming connection requests. A web browser -would open an active socket because it is attempting to connect to a -specified remote host. +bl = 9 (get socket options + in: + ecx = socket number + edx = level + esi = optionname + edi = ptr to buffer -Access to programming interface -=============================== -The developer accesses the stack functions through interrupt 0x40, -function 53. Some functions may be accessed through function 52, but these -are mainly for stack configuration. -Here is a summary of the functions that you may use and the parameter -definitions. +The buffer's first dword is the length of the buffer, minus the first dword offcourse + out: + eax = -1 on error, socket option otherwise -Get Local IP Address --------------------- -eax = 52 -ebx = 1 +TIP -IP address returned in eax ( in internet byte order ) +when you import 'network.inc' and 'macros.inc' into your source code, you can use the following syntax to work with sockets: -Write to stack input queue --------------------------- -eax = 52 -ebx = 6 -edx = number of bytes to write -esi = pointer to data ( in application space ) +for example, to open a socket -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. -This interface is for slow network drivers only ( PPP, SLIP ) +mcall socket, AF_INET, SOCK_DGRAM,0 +mov [socketnum], eax +then to connect to a server -Read data from network output queue ------------------------------------ -eax = 52 -ebx = 8 -esi = pointer to data ( in application space ) +mcall connect, [socketnum], sockaddr, 18 -On return, eax holds number of bytes transferred. -This interface is for slow network drivers only ( PPP, SLIP ) +eax = 76 - Work with protocols -Open a UDP socket ------------------ -eax = 53 -ebx = 0 -ecx = local port -edx = remote port -esi = remote ip address ( in internet byte order ) +high half of ebx = protocol number (for all subfunctions!) +bh = device number (for all subfunctions!) +bl = subfunction number, depends on protocol type -The socket number allocated is returned in eax. -A return value of 0xFFFFFFFF means no socket could be opened. +For Ethernet protocol +0 - Read # Packets send +1 - Read # Packets received +2 - Read # Bytes send +3 - Read # Bytes received +4 - Read MAC +5 - Write MAC +6 - Read IN-QUEUE size +7 - Read OUT-QUEUE size +For IPv4 protocol -Open a TCP socket ------------------ -eax = 53 -ebx = 5 -ecx = local port -edx = remote port -esi = remote ip address ( in internet byte order ) -edi = mode : SOCKET_PASSIVE or SOCKET_ACTIVE ( defined in stack.inc ) +0 - Read # IP packets send +1 - Read # IP packets received +2 - Read IP +3 - Write IP +4 - Read DNS +5 - Write DNS +6 - Read subnet +7 - Write subnet +8 - Read gateway +9 - Write gateway +For ARP protocol -The socket number allocated is returned in eax. -A return value of 0xFFFFFFFF means no socket could be opened. +0 - Read # ARP packets send +1 - Read # ARP packets received +2 - Get # ARP entry's +3 - Read ARP entry +4 - Add static ARP entry +5 - Remove ARP entry (-1 = remove all) +For ICMP protocol +0 - Read # ICMP packets send +1 - Read # ICMP packets received +3 - enable/disable ICMP echo reply +For UDP protocol -Close a socket (UDP Only ) --------------------------- -eax = 53 -ebx = 1 -ecx = socket number +0 - Read # UDP packets send +1 - Read # UDP packets received +For TCP protocol -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Close a socket (TCP Only ) --------------------------- -eax = 53 -ebx = 8 -ecx = socket number - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Poll socket ------------ -eax = 53 -ebx = 2 -ecx = socket number - -On return, eax holds the number of bytes in the receive buffer. - - -Read socket data ----------------- -eax = 53 -ebx = 3 -ecx = socket number - -On return, eax holds the number of bytes remaining, bl holds a data byte. - - -Write to socket ( UDP only ) ----------------------------- -eax = 53 -ebx = 4 -ecx = socket number -edx = number of bytes to write -esi = pointer to data ( in application space ) - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Return socket status ( TCP only ) ---------------------------------- -eax = 53 -ebx = 6 -ecx = socket number - -On return, eax holds the sockets TCP status. -This function can be used to determine when a socket has actually connected -to another socket - data cannot be written to a socket until the connection -is established (TCB_ESTABLISHED). The states a socket can be in are defined -in stack.inc as TCB_ - - -Write to socket ( TCP only ) ----------------------------- -eax = 53 -ebx = 7 -ecx = socket number -edx = number of bytes to write -esi = pointer to data ( in application space ) - -On return, eax holds 0 for OK, or 0xFFFFFFFF for error. - - -Check port number ------------------ -eax = 53 -ebx = 9 -ecx = port number - -This function is used to determine if a port number -is in use by any sockets as a local port number. Local -port numbers are normally unique. - -On return, eax is 1 for port number not in use, 0 otherwise. - - -Opening a TCP socket in Kolibri -=============================== - -There are two ways to open a socket - Passive or Active. - -In a Passive connection your application 'listens' for incoming -requests from remote applications. Typically this will be done when -you are implementing a server application that allows any other -application to connect to it. You would specify a 'known' local -port number, such as 80 for a web server. You would leave the -remote IP and remote port number as 0, which indicates any -remote application may connect. - -Once the socket has been opened you would wait for an incoming -connection before doing anything. This can be by either checking -the socket status for TCB_ESTABLISHED, or waiting for data in the -receive buffer. - -In an Active connection, you are making a connection to a specified -remote port. The remote IP and remote port parameters must be filled -in with non-zero values ( otherwise, what are you connecting to? ). -You also specify a unique local port number so the remote application -can uniquely identify you - after all, there may be several applications -on your machine connected to the same remote host. See below for finding -a unique port number. - - -How to find an unused local port number -======================================= - -Typically when you are creating an active connection to a remote -socket you will want to choose a unique local port number. Local -port numbers normally start from 1000; The following code may -be used to obtain an unused port number prior to making the -open socket call. - - mov ecx, 1000 ; local port starting at 1000 - -getlp: - inc ecx - push ecx - mov eax, 53 - mov ebx, 9 - int 0x40 - pop ecx - cmp eax, 0 ; is this local port in use? - jz getlp ; yes - so try next - - ; ecx contains a free local port number - - - -Writing data to a socket -======================== - -There are two functions available depending on whether the socket -was opened for TCP or UDP protocol; The call parameters are the -same however. When the socket is being opened for TCP, use the -status function to poll for a connection - data cannot be written -to a socket until another socket has connected to it, and the -state of the socket is TCB_ESTABLISHED. - -When you write data, the call results in a single IP packet being -created and transmitted. Thus the user application is responsible for -the size of transmitted packets. Keep the packet sizes under 768 bytes. -If you are writing a terminal program like telnet, you may want to send -a packet for each keystroke ( inefficient ) or use a timer to send data -periodically ( say, every second ). - - -Reading data from a socket -========================== - -There is one function to read data from a sockets receive buffer. This -function retrieves one byte at a time. You can use the poll function to -test the receive buffer for data. - - -Closing a socket -================ - -Simply call the appropriate function - there is one for TCP, and another -for UDP. When closing a TCP socket, don't forget that the other end -may continue to send data, so the socket may remain active for a -few seconds after your call. - - -If you have any questions or have suggestions for improving this -document please contact me at mikeh@oceanfree.net. +0 - Read # TCP packets send +1 - Read # TCP packets received \ No newline at end of file diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index f02fbfe098..96dad1186e 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -2419,391 +2419,6 @@ dword-значение цвета 0x00RRGGBB * eax = -1 - ошибка (в системе слишком много потоков) * иначе eax = TID - идентификатор потока -====================================================================== -= Функция 52, подфункция 0 - получить конфигурацию сетевого драйвера. -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 0 - номер подфункции -Возвращаемое значение: - * eax = двойное слово конфигурации -Замечания: - * Слово конфигурации можно установить подфункцией 2. - * Ядро не использует соответствующую переменную. - Ценность этой переменной и работающих с ней подфункций 0 и 2 - представляется сомнительной. - -====================================================================== -======= Функция 52, подфункция 1 - получить локальный IP-адрес. ====== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 1 - номер подфункции -Возвращаемое значение: - * eax = IP-адрес (4 байта) -Замечания: - * Локальный IP-адрес устанавливается подфункцией 3. - -====================================================================== - Функция 52, подфункция 2 - установить конфигурацию сетевого драйвера. -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 2 - номер подфункции - * ecx = двойное слово конфигурации; если младшие 7 бит образуют - число 3, это воспринимается как запрос на [пере-]инициализацию - Ethernet-карты, в противном случае Ethernet выключается -Возвращаемое значение: - * если не запрошен Ethernet-интерфейс, то возвращается eax=2, - но это может измениться в будущих версиях ядра - * если запрошен Ethernet-интерфейс, то eax=0 означает ошибку - (отсутствие Ethernet-карты), а ненулевое значение - успех -Замечания: - * Слово конфигурации можно прочитать подфункцией 0. - * Ядро не использует соответствующую переменную. - Ценность этой переменной, подфункции 0 и части подфункции 2, - устанавливающей эту переменную, представляется сомнительной. - -====================================================================== -====== Функция 52, подфункция 3 - установить локальный IP-адрес. ===== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 3 - номер подфункции - * ecx = IP-адрес (4 байта) -Возвращаемое значение: - * текущая реализация возвращает eax=3, но это может быть изменено - в будущих версиях -Замечания: - * Локальный IP-адрес можно получить подфункцией 1. - -====================================================================== -= Функция 52, подфункция 6 - добавить данные в стек входной очереди. = -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 6 - номер подфункции - * edx = размер данных - * esi = указатель на данные -Возвращаемое значение: - * eax = -1 - ошибка - * eax = 0 - успешно -Замечания: - * Эта функция предназначена только для медленных сетевых драйверов - (PPP, SLIP). - * Размер данных не должен превосходить 1500 байт, - хотя проверок корректности не делается. - -====================================================================== -====================== Функция 52, подфункция 8 ====================== -============= Прочитать данные из сетевой очереди вывода. ============ -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 8 - номер подфункции - * esi = указатель на буфер размером 1500 байт -Возвращаемое значение: - * eax = число прочитанных байт (в текущей реализации - либо 0 = нет данных, либо 1500) - * данные скопированы в буфер -Замечания: - * Эта функция предназначена только для медленных сетевых драйверов - (PPP, SLIP). - -====================================================================== -=========== Функция 52, подфункция 9 - получить gateway IP. ========== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 9 - номер подфункции -Возвращаемое значение: - * eax = gateway IP (4 байта) - -====================================================================== -========= Функция 52, подфункция 10 - получить маску подсети. ======== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 10 - номер подфункции -Возвращаемое значение: - * eax = маска подсети - -====================================================================== -========= Функция 52, подфункция 11 - установить gateway IP. ========= -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 11 - номер подфункции - * ecx = gateway IP (4 байта) -Возвращаемое значение: - * текущая реализация возвращает eax=11, но это может быть изменено - в будущих реализациях - -====================================================================== -======== Функция 52, подфункция 12 - установить маску подсети. ======= -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 12 - номер подфункции - * ecx = маска подсети -Возвращаемое значение: - * текущая реализация возвращает eax=12, но это может быть изменено - в будущих версиях - -====================================================================== -============ Функция 52, подфункция 13 - получить DNS IP. ============ -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 13 - номер подфункции -Возвращаемое значение: - * eax = DNS IP (4 байта) - -====================================================================== -=========== Функция 52, подфункция 14 - установить DNS IP. =========== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 14 - номер подфункции - * ecx = DNS IP (4 байта) -Возвращаемое значение: - * текущая реализация возвращает eax=14, но это может быть изменено - в следующих версиях - -====================================================================== -====== Функция 52, подфункция 15 - получить локальный MAC-адрес. ===== -====================================================================== -Параметры: - * eax = 52 - номер функции - * ebx = 15 - номер подфункции - * ecx = 0 - читать первые 4 байта, - ecx = 4 - читать последние 2 байта -Возвращаемое значение: - * для ecx=0: eax = первые 4 байта MAC-адреса - * для ecx=4: ax = последние 2 байта MAC-адреса, - старшая половина eax разрушается - * для других ecx: eax = -1 как признак ошибки - -====================================================================== -============ Функция 53, подфункция 0 - открыть UDP-сокет. =========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 0 - номер подфункции - * ecx = локальный порт (учитывается только младшее слово), - ecx = 0 - предоставить системе выбор локального порта - * edx = удалённый порт (учитывается только младшее слово) - * esi = удалённый IP -Возвращаемое значение: - * eax = -1 = 0xFFFFFFFF - ошибка; ebx разрушается - * eax = хэндл сокета (некоторое число, однозначно идентифицирующее - сокет и имеющее смысл только для системы) - успешно; - ebx разрушается - -====================================================================== -============ Функция 53, подфункция 1 - закрыть UDP-сокет. =========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 1 - номер подфункции - * ecx = хэндл сокета -Возвращаемое значение: - * eax = -1 - неверный хэндл - * eax = 0 - успешно - * ebx разрушается -Замечания: - * Текущая реализация не закрывает автоматически все сокеты потока - при его завершении. В частности, не следует прибивать поток - с кучей открытых сокетов - будет утечка ресурсов. - -====================================================================== -============== Функция 53, подфункция 2 - опрос сокета. ============== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 2 - номер подфункции - * ecx = хэндл сокета -Возвращаемое значение: - * eax = число полученных байт, 0 для неверного хэндла - * ebx разрушается - -====================================================================== -======== Функция 53, подфункция 3 - прочитать байт из сокета. ======== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 3 - номер подфункции - * ecx = хэндл сокета -Возвращаемое значение: - * если нет принятых данных или указан неверный хэндл: - eax=0, bl=0, прочие байты ebx разрушаются - * если были принятые данные: eax=число оставшихся байт - (возможно, 0), bl=прочитанный байт, прочие байты ebx разрушаются - -====================================================================== -========== Функция 53, подфункция 4 - записать в UDP-сокет. ========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 4 - номер подфункции - * ecx = хэндл сокета - * edx = число байт для записи - * esi = указатель на данные для записи -Возвращаемое значение: - * eax = 0xffffffff - ошибка (неверный хэндл или недостаточно памяти) - * eax = 0 - успешно - * ebx разрушается -Замечания: - * Число байт для записи не может превышать 1500-28, хотя - соответствующей проверки не делается. - -====================================================================== -============ Функция 53, подфункция 5 - открыть TCP-сокет. =========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 5 - номер подфункции - * ecx = локальный порт (учитывается только младшее слово), - ecx = 0 - предоставить системе выбор локального порта - * edx = удалённый порт (учитывается только младшее слово) - * esi = удалённый IP - * edi = режим открытия: SOCKET_PASSIVE=0 или SOCKET_ACTIVE=1 -Возвращаемое значение: - * eax = -1 = 0xFFFFFFFF - ошибка; ebx разрушается - * eax = хэндл сокета (некоторое число, однозначно идентифицирующее - сокет и имеющее смысл только для системы) - успешно; - ebx разрушается - -====================================================================== -====== Функция 53, подфункция 6 - получить состояние TCP-сокета. ===== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 6 - номер подфункции - * ecx = хэндл сокета -Возвращаемое значение: - * eax = 0 для неверного сокета или статус: одно из - * TCB_LISTEN = 1 - * TCB_SYN_SENT = 2 - * TCB_SYN_RECEIVED = 3 - * TCB_ESTABLISHED = 4 - * TCB_FIN_WAIT_1 = 5 - * TCB_FIN_WAIT_2 = 6 - * TCB_CLOSE_WAIT = 7 - * TCB_CLOSING = 8 - * TCB_LAST_ASK = 9 - * TCB_TIME_WAIT = 10 - * TCB_CLOSED = 11 - * ebx разрушается - -====================================================================== -========== Функция 53, подфункция 7 - записать в TCP-сокет. ========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 7 - номер подфункции - * ecx = хэндл сокета - * edx = число байт для записи - * esi = указатель на данные для записи -Возвращаемое значение: - * eax = 0xffffffff - ошибка (неверный хэндл или недостаточно памяти) - * eax = 0 - успешно - * ebx разрушается -Замечания: - * Число байт для записи не может превышать 1500-40, - хотя соответствующей проверки не делается. - -====================================================================== -============ Функция 53, подфункция 8 - закрыть TCP-сокет. =========== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 8 - номер подфункции - * ecx = хэндл сокета -Возвращаемое значение: - * eax = -1 - ошибка (неверный хэндл или - недостаточно памяти для пакета закрытия сокета) - * eax = 0 - успешно - * ebx разрушается -Замечания: - * Текущая реализация не закрывает автоматически все сокеты потока - при его завершении. В частности, не следует прибивать поток - с кучей открытых сокетов - будет утечка ресурсов. - -====================================================================== -== Функция 53, подфункция 9 - проверить, свободен ли локальный порт. = -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 9 - номер подфункции - * ecx = номер локального порта (используются только младшие 16 бит) -Возвращаемое значение: - * eax = 0 - порт используется - * eax = 1 - порт свободен - * ebx разрушается - -====================================================================== -==== Функция 53, подфункция 10 - получить статус кабеля Ethernet. ==== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 10 - номер подфункции -Возвращаемое значение: - * al = -1 - драйвер сетевой карты не загружен или - не поддерживает эту функцию - * al = 0 - кабель не подключён - * al = 1 - кабель подключён - * ebx разрушается -Замечания: - * Текущая реализация ядра поддерживает эту функцию - только для сетевых карт RTL8139. - -====================================================================== -==== Функция 53, подфункция 11 - прочитать данные сетевого стека. ==== -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 11 - номер подфункции - * ecx = хэндл сокета - * edx = указатель на буфер - * esi = число байт для чтения; - * esi = 0 - читать все данные (максимум 4096 байт) -Возвращаемое значение: - * eax = число прочитанных байт (0 при неверном хэндле) - * ebx разрушается - -====================================================================== - Функция 53, подфункция 255 - отладочная информация сетевого драйвера. -====================================================================== -Параметры: - * eax = 53 - номер функции - * ebx = 255 - номер подфункции - * ecx = тип запрашиваемой информации (смотри ниже) -Возвращаемое значение: - * eax = запрошенная информация - * ebx разрушается -Возможные значения ecx: - * 100: длина очереди 0 (empty queue) - * 101: длина очереди 1 (ip-out queue) - * 102: длина очереди 2 (ip-in queue) - * 103: длина очереди 3 (net1out queue) - * 200: число элементов в таблице ARP - * 201: размер таблицы ARP (в элементах) (20 в текущей версии) - * 202: прочитать элемент edx таблицы ARP во временный буфер, откуда - берут информацию 5 последующих типов; - в этом случае eax неопределён - * 203: IP-адрес, запомненный типом 202 - * 204: старшее dword MAC-адреса, запомненного типом 202 - * 205: младшее word MAC-адреса, запомненного типом 202 - * 206: слово статуса, запомненное типом 202 - * 207: слово ttl, запомненное типом 202 - * 2: общее число полученных IP-пакетов - * 3: общее число переданных IP-пакетов - * 4: общее число сдампленных полученных пакетов - * 5: общее число полученных ARP-пакетов - * 6: статус драйвера пакетов, 0=неактивен, - ненулевое значение=активен - ====================================================================== ====================== Функция 55, подфункция 55 ===================== ========== Начать проигрывать данные на встроенном спикере. ========== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index 9dd146e268..c582d34cca 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -2410,408 +2410,6 @@ Returned value: * otherwise eax = TID - thread identifier -====================================================================== -=========================== Function 52 ============================== -====================================================================== - -WARNING: This function is obsolete and is only present in the - documentation as a guide to understand/port the older network - applications. For new programs, use function 74 - -====================================================================== -=== Function 52, subfunction 0 - get network driver configuration. === -====================================================================== - -Parameters: - * eax = 52 - function number - * ebx = 0 - subfunction number -Returned value: - * eax = configuration dword -Remarks: - * Configuration dword can be set by subfunction 2. - * The kernel does not use this variable. The value of this - variable and working with it subfunctions 0 and 2 is represented - doubtful. - -====================================================================== -========= Function 52, subfunction 1 - get local IP-address. ========= -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 1 - subfunction number -Returned value: - * eax = IP-address (4 bytes) -Remarks: - * Local IP-address is set by subfunction 3. - -====================================================================== -=== Function 52, subfunction 2 - set network driver configuration. === -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 2 - subfunction number - * ecx = configuration dword; if low 7 bits derivate the number 3, - function [re-]initializes Ethernet-card, otherwise - Ethernet turns off -Returned value: - * if Ethernet-interface is not requested, function returns eax=2, - but this can be changed in future kernel versions - * if Ethernet-interface is requested, eax=0 means error - (absence of Ethernet-card), and nonzero value - success -Remarks: - * Configuration dword can be read by subfunction 0. - * The kernel does not use this variable. The value of this - variable, subfunction 0 and part of subfunction 2, which set it, - is represented doubtful. - -====================================================================== -========= Function 52, subfunction 3 - set local IP-address. ========= -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 3 - subfunction number - * ecx = IP-address (4 bytes) -Returned value: - * the current implementation returns eax=3, but this can be changed - in future versions -Remarks: - * Local IP-address can be get by subfunction 1. - -====================================================================== -= Function 52, subfunction 6 - add data to the stack of input queue. = -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 6 - subfunction number - * edx = data size - * esi = data pointer -Returned value: - * eax = -1 - error - * eax = 0 - success -Remarks: - * This function is intended only for slow network drivers - (PPP, SLIP). - * Data size must not exceed 1500 bytes, though function - performs no checks on correctness. - -====================================================================== - Function 52, subfunction 8 - read data from the network output queue. -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 8 - subfunction number - * esi = pointer to 1500-byte buffer -Returned value: - * eax = number of read bytes (in the current implementation - either 0 = no data or 1500) - * data was copied in buffer -Remarks: - * This function is intended only for slow network drivers - (PPP, SLIP). - -====================================================================== -============ Function 52, subfunction 9 - get gateway IP. ============ -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 9 - subfunction number -Returned value: - * eax = gateway IP (4 bytes) - -====================================================================== -=========== Function 52, subfunction 10 - get subnet mask. =========== -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 10 - subfunction number -Returned value: - * eax = subnet mask - -====================================================================== -============ Function 52, subfunction 11 - set gateway IP. =========== -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 11 - subfunction number - * ecx = gateway IP (4 bytes) -Returned value: - * the current implementation returns eax=11, but this can be changed - in future versions - -====================================================================== -=========== Function 52, subfunction 12 - set subnet mask. =========== -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 12 - subfunction number - * ecx = subnet mask -Returned value: - * the current implementation returns eax=12, but this can be changed - in future versions - -====================================================================== -============== Function 52, subfunction 13 - get DNS IP. ============= -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 13 - subfunction number -Returned value: - * eax = DNS IP (4 bytes) - -====================================================================== -============== Function 52, subfunction 14 - set DNS IP. ============= -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 14 - subfunction number - * ecx = DNS IP (4 bytes) -Returned value: - * the current implementation returns eax=14, but this can be changed - in future versions - -====================================================================== -======== Function 52, subfunction 15 - get local MAC address. ======== -====================================================================== -Parameters: - * eax = 52 - function number - * ebx = 15 - subfunction number - * ecx = 0 - read first 4 bytes, - ecx = 4 - read last 2 bytes -Returned value: - * for ecx=0: eax = first 4 bytes of MAC address - * for ecx=4: ax = last 2 bytes of MAC address, - high half of eax is destroyed - * for other ecx: eax = -1 indicates an error - -====================================================================== -=========================== Function 53 ============================== -====================================================================== - -WARNING: This function is obsolete and is only present in the - documentation as a guide to understand/port the older network - applications. For new programs, use function 75. - -====================================================================== -============ Function 53, subfunction 0 - open UDP-socket. =========== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 0 - subfunction number - * ecx = local port (only low word is taken into account), - ecx = 0 - let the system choose a port - * edx = remote port (only low word is taken into account) - * esi = remote IP -Returned value: - * eax = -1 = 0xFFFFFFFF - error; ebx destroyed - * eax = socket handle (some number which unambiguously identifies - socket and have sense only for the system) - success; - ebx destroyed - -====================================================================== -=========== Function 53, subfunction 1 - close UDP-socket. =========== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 1 - subfunction number - * ecx = socket handle -Returned value: - * eax = -1 - incorrect handle - * eax = 0 - success - * ebx destroyed -Remarks: - * The current implementation does not close automatically all - sockets of a thread at termination. In particular, one should not - kill a thread with many opened sockets - there will be an outflow - of resources. - -====================================================================== -============== Function 53, subfunction 2 - poll socket. ============= -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 2 - subfunction number - * ecx = socket handle -Returned value: - * eax = number of read bytes, 0 for incorrect handle - * ebx destroyed - -====================================================================== -========= Function 53, subfunction 3 - read byte from socket. ======== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 3 - subfunction number - * ecx = socket handle -Returned value: - * if there is no read data or handle is incorrect: eax=0, bl=0, - other bytes of ebx are destroyed - * if there are read data: eax=number of rest bytes - (possibly 0), bl=read byte, other bytes of ebx are destroyed - -====================================================================== -========== Function 53, subfunction 4 - write to UDP-socket. ========= -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 4 - subfunction number - * ecx = socket handle - * edx = number of bytes to write - * esi = pointer to data to write -Returned value: - * eax = 0xffffffff - error (invalid handle or not enough memory) - * eax = 0 - success - * ebx destroyed -Remarks: - * Number of bytes to write must not exceed 1500-28, though - the appropriate check is not made. - -====================================================================== -============ Function 53, subfunction 5 - open TCP-socket. =========== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 5 - subfunction number - * ecx = local port (only low word is taken into account), - ecx = 0 - let the system choose a port - * edx = remote port (only low word is taken into account) - * esi = remote IP - * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1 -Returned value: - * eax = -1 = 0xFFFFFFFF - error; ebx destroys - * eax = socket handle (some number which unambiguously identifies - socket and have sense only for the system) - success; - ebx destroyed - -====================================================================== -========= Function 53, subfunction 6 - get TCP-socket status. ======== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 6 - subfunction number - * ecx = socket handle -Returned value: - * eax = 0 for incorrect handle or socket status: one of - * TCB_LISTEN = 1 - * TCB_SYN_SENT = 2 - * TCB_SYN_RECEIVED = 3 - * TCB_ESTABLISHED = 4 - * TCB_FIN_WAIT_1 = 5 - * TCB_FIN_WAIT_2 = 6 - * TCB_CLOSE_WAIT = 7 - * TCB_CLOSING = 8 - * TCB_LAST_ASK = 9 - * TCB_TIME_WAIT = 10 - * TCB_CLOSED = 11 - * ebx destroyed - -====================================================================== -========== Function 53, subfunction 7 - write to TCP-socket. ========= -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 7 - subfunction number - * ecx = socket handle - * edx = number of bytes to write - * esi = pointer to data to write -Returned value: - * eax = 0xffffffff - error (invalid handle or not enough memory) - * eax = 0 - success - * ebx destroyed -Remarks: - * Number of bytes to write must not exceed 1500-40, though - the appropriate check is not made. - -====================================================================== -=========== Function 53, subfunction 8 - close TCP-socket. =========== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 8 - subfunction number - * ecx = socket handle -Returned value: - * eax = -1 - error (invalid handle or - not enough memory for socket close packet) - * eax = 0 - success - * ebx destroyed -Remarks: - * The current implementation does not close automatically all - sockets of a thread at termination. In particular, one should not - kill a thread with many opened sockets - there will be an outflow - of resources. - -====================================================================== -=== Function 53, subfunction 9 - check whether local port is free. === -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 9 - subfunction number - * ecx = local port number (low 16 bits are used only) -Returned value: - * eax = 0 - port is used - * eax = 1 - port is free - * ebx destroyed - -====================================================================== -===== Function 53, subfunction 10 - query Ethernet cable status. ===== -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 10 - subfunction number -Returned value: - * al = -1 - a network driver is not loaded or - does not support this function - * al = 0 - Ethernet cable is unplugged - * al = 1 - Ethernet cable is plugged - * ebx destroyed -Remarks: - * The current kernel implementation supports this function - only for RTL8139 network cards. - -====================================================================== -======= Function 53, subfunction 11 - read network stack data. ======= -====================================================================== -Paramters: - * eax = 53 - function number - * ebx = 11 - subfunction number - * ecx = socket handle - * edx = pointer to buffer - * esi = number of bytes to read; - * esi = 0 - read all data (maximum 4096 bytes) -Returned value: - * eax = number of bytes read (0 for incorrect handle) - * ebx destroyed - -====================================================================== -= Function 53, subfunction 255 - debug information of network driver. -====================================================================== -Parameters: - * eax = 53 - function number - * ebx = 255 - subfunction number - * ecx = type of requested information (see below) -Returned value: - * eax = requested information - * ebx destroyed -Possible values for ecx: - * 100: length of queue 0 (empty queue) - * 101: length of queue 1 (ip-out queue) - * 102: length of queue 2 (ip-in queue) - * 103: length of queue 3 (net1out queue) - * 200: number of items in the ARP table - * 201: size of the ARP table (in items) (20 for current version) - * 202: read item at edx of the ARP table to the temporary buffer, - whence 5 following types take information; - in this case eax is not defined - * 203: IP-address saved by type 202 - * 204: high dword of MAC-address saved by type 202 - * 205: low word of MAC-address saved by type 202 - * 206: status word saved by type 202 - * 207: ttl word saved by type 202 - * 2: total number of received IP-packets - * 3: total number of transferred IP-packets - * 4: total number of dumped received packets - * 5: total number of received ARP-packets - * 6: status of packet driver, 0=inactive, nonzero=active - ====================================================================== Function 55, subfunction 55 - begin to play data on built-in speaker. ====================================================================== diff --git a/programs/system/docpack/trunk/docpack.asm b/programs/system/docpack/trunk/docpack.asm index 8db133e2ae..69006661cf 100755 --- a/programs/system/docpack/trunk/docpack.asm +++ b/programs/system/docpack/trunk/docpack.asm @@ -180,13 +180,13 @@ end if embed_file 'MTDBG.TXT' ;e if lang eq ru embed_file 'SYSFUNCR.TXT' ;f - embed_file 'STACK_RU.TXT' ;g else embed_file 'SYSFUNCS.TXT' ;f - embed_file 'STACK.TXT' ;g end if + embed_file 'STACK.TXT' ;g embed_file 'KFAR_KEYS.TXT' ;h embed_file 'INI.TXT' ;i + embed_file 'OPENDIAL.TXT' ;j ; -- End of embedding area ------- dd 0