/programs/debug-fdo.inc |
---|
0,0 → 1,422 |
; |
; Formatted Debug Output (FDO) |
; Copyright (c) 2005-2006, mike.dld |
; Created: 2005-01-29, Changed: 2006-11-10 |
; |
; For questions and bug reports, mail to mike.dld@gmail.com |
; |
; Available format specifiers are: %s, %d, %u, %x (with partial width support) |
; |
; to be defined: |
; __DEBUG__ equ 1 |
; __DEBUG_LEVEL__ equ 5 |
macro debug_func name { |
if used name |
name@of@func equ name |
} |
macro debug_beginf { |
align 4 |
name@of@func: |
} |
debug_endf fix end if |
macro DEBUGS _sign,[_str] { |
common |
local tp |
tp equ 0 |
match _arg:_num,_str \{ |
DEBUGS_N _sign,_num,_arg |
tp equ 1 |
\} |
match =0 _arg,tp _str \{ |
DEBUGS_N _sign,,_arg |
\} |
} |
macro DEBUGS_N _sign,_num,[_str] { |
common |
pushf |
pushad |
local ..str,..label,is_str |
is_str = 0 |
forward |
if _str eqtype '' |
is_str = 1 |
end if |
common |
if is_str = 1 |
jmp ..label |
..str db _str,0 |
..label: |
add esp,4*8+4 |
mov edx,..str |
sub esp,4*8+4 |
else |
mov edx,_str |
end if |
if ~_num eq |
if _num eqtype eax |
if _num in <eax,ebx,ecx,edx,edi,ebp,esp> |
mov esi,_num |
else if ~_num eq esi |
movzx esi,_num |
end if |
else if _num eqtype 0 |
mov esi,_num |
else |
local tp |
tp equ 0 |
match [_arg],_num \{ |
mov esi,dword[_arg] |
tp equ 1 |
\} |
match =0 =dword[_arg],tp _num \{ |
mov esi,dword[_arg] |
tp equ 1 |
\} |
match =0 =word[_arg],tp _num \{ |
movzx esi,word[_arg] |
tp equ 1 |
\} |
match =0 =byte[_arg],tp _num \{ |
movzx esi,byte[_arg] |
tp equ 1 |
\} |
match =0,tp \{ |
'Error: specified string width is incorrect' |
\} |
end if |
else |
mov esi,0x7FFFFFFF |
end if |
call fdo_debug_outstr |
popad |
popf |
} |
macro DEBUGD _sign,_dec { |
local tp |
tp equ 0 |
match _arg:_num,_dec \{ |
DEBUGD_N _sign,_num,_arg |
tp equ 1 |
\} |
match =0 _arg,tp _dec \{ |
DEBUGD_N _sign,,_arg |
\} |
} |
macro DEBUGD_N _sign,_num,_dec { |
pushf |
pushad |
if (~_num eq) |
if (_dec eqtype eax | _dec eqtype 0) |
'Error: precision allowed only for in-memory variables' |
end if |
if (~_num in <1,2,4>) |
if _sign |
'Error: 1, 2 and 4 are only allowed for precision in %d' |
else |
'Error: 1, 2 and 4 are only allowed for precision in %u' |
end if |
end if |
end if |
if _dec eqtype eax |
if _dec in <ebx,ecx,edx,esi,edi,ebp,esp> |
mov eax,_dec |
else if ~_dec eq eax |
if _sign = 1 |
movsx eax,_dec |
else |
movzx eax,_dec |
end if |
end if |
else if _dec eqtype 0 |
mov eax,_dec |
else |
add esp,4*8+4 |
if _num eq |
mov eax,dword _dec |
else if _num = 1 |
if _sign = 1 |
movsx eax,byte _dec |
else |
movzx eax,byte _dec |
end if |
else if _num = 2 |
if _sign = 1 |
movsx eax,word _dec |
else |
movzx eax,word _dec |
end if |
else |
mov eax,dword _dec |
end if |
sub esp,4*8+4 |
end if |
mov cl,_sign |
call fdo_debug_outdec |
popad |
popf |
} |
macro DEBUGH _sign,_hex { |
local tp |
tp equ 0 |
match _arg:_num,_hex \{ |
DEBUGH_N _sign,_num,_arg |
tp equ 1 |
\} |
match =0 _arg,tp _hex \{ |
DEBUGH_N _sign,,_arg |
\} |
} |
macro DEBUGH_N _sign,_num,_hex { |
pushf |
pushad |
if (~_num eq) & (~_num in <1,2,3,4,5,6,7,8>) |
'Error: 1..8 are only allowed for precision in %x' |
end if |
if _hex eqtype eax |
if _hex in <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
if ~_hex eq eax |
mov eax,_hex |
end if |
else if _hex in <ax,bx,cx,dx,si,di,bp,sp> |
if ~_hex eq ax |
movzx eax,_hex |
end if |
shl eax,16 |
if (_num eq) |
mov edx,4 |
end if |
else if _hex in <al,ah,bl,bh,cl,ch,dl,dh> |
if ~_hex eq al |
movzx eax,_hex |
end if |
shl eax,24 |
if (_num eq) |
mov edx,2 |
end if |
end if |
else if _hex eqtype 0 |
mov eax,_hex |
else |
add esp,4*8+4 |
mov eax,dword _hex |
sub esp,4*8+4 |
end if |
if ~_num eq |
mov edx,_num |
else |
mov edx,8 |
end if |
call fdo_debug_outhex |
popad |
popf |
} |
;----------------------------------------------------------------------------- |
debug_func fdo_debug_outchar |
debug_beginf |
pushad |
mov cl,al |
mov ebx,1 |
mov eax,63 |
mcall |
popad |
ret |
debug_endf |
debug_func fdo_debug_outstr |
debug_beginf |
mov eax,63 |
mov ebx,1 |
.l1: dec esi |
js .l2 |
mov cl,[edx] |
or cl,cl |
jz .l2 |
mcall |
inc edx |
jmp .l1 |
.l2: ret |
debug_endf |
debug_func fdo_debug_outdec |
debug_beginf |
or cl,cl |
jz @f |
or eax,eax |
jns @f |
neg eax |
push eax |
mov al,'-' |
call fdo_debug_outchar |
pop eax |
@@: push 10 |
pop ecx |
push -'0' |
.l1: xor edx,edx |
div ecx |
push edx |
test eax,eax |
jnz .l1 |
.l2: pop eax |
add al,'0' |
jz .l3 |
call fdo_debug_outchar |
jmp .l2 |
.l3: ret |
debug_endf |
debug_func fdo_debug_outhex |
__fdo_hexdigits db '0123456789ABCDEF' |
debug_beginf |
mov cl,dl |
neg cl |
add cl,8 |
shl cl,2 |
rol eax,cl |
.l1: rol eax,4 |
push eax |
and eax,0x0000000F |
mov al,[__fdo_hexdigits+eax] |
call fdo_debug_outchar |
pop eax |
dec edx |
jnz .l1 |
ret |
debug_endf |
;----------------------------------------------------------------------------- |
macro DEBUGF _level,_format,[_arg] { |
common |
if __DEBUG__ = 1 & _level >= __DEBUG_LEVEL__ |
local ..f1,f2,a1,a2,c1,c2,c3,..lbl |
_debug_str_ equ __debug_str_ # a1 |
a1 = 0 |
c2 = 0 |
c3 = 0 |
f2 = 0 |
repeat ..lbl-..f1 |
virtual at 0 |
db _format,0,0 |
load c1 word from %-1 |
end virtual |
if c1 = '%s' |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER S,a1,0,_arg |
else if c1 = '%x' |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER H,a1,0,_arg |
else if c1 = '%d' | c1 = '%u' |
local c4 |
if c1 = '%d' |
c4 = 1 |
else |
c4 = 0 |
end if |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER D,a1,c4,_arg |
else if c1 = '\n' |
c3 = c3 + 1 |
end if |
end repeat |
virtual at 0 |
db _format,0,0 |
load c1 from f2-c2 |
end virtual |
if (c1<>0)&(f2<>..lbl-..f1-1) |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
virtual at 0 |
..f1 db _format,0 |
..lbl: |
__debug_strings equ __debug_strings,_debug_str_,<_format>,..lbl-..f1-1-c2-c3 |
end virtual |
end if |
} |
macro __include_debug_strings dummy,[_id,_fmt,_len] { |
common |
local c1,a1,a2 |
forward |
if defined _len & ~_len eq |
_id: |
a1 = 0 |
a2 = 0 |
repeat _len |
virtual at 0 |
db _fmt,0,0 |
load c1 word from %+a2-1 |
end virtual |
if (c1='%s')|(c1='%x')|(c1='%d')|(c1='%u') |
db 0 |
a2 = a2 + 1 |
else if (c1='\n') |
dw $0A0D |
a1 = a1 + 1 |
a2 = a2 + 1 |
else |
db c1 and 0x0FF |
end if |
end repeat |
db 0 |
end if |
} |
macro DEBUGF_HELPER _letter,_num,_sign,[_arg] { |
common |
local num |
num = 0 |
forward |
if num = _num |
DEBUG#_letter _sign,_arg |
end if |
num = num+1 |
common |
_num = _num+1 |
} |
macro include_debug_strings { |
if __DEBUG__ = 1 |
match dbg_str,__debug_strings \{ |
__include_debug_strings dbg_str |
\} |
end if |
} |
/programs/libio.inc |
---|
0,0 → 1,113 |
;;================================================================================================;; |
;;//// libio.inc //// (c) mike.dld, 2007-2008 ////////////////////////////////////////////////////;; |
;;================================================================================================;; |
;; ;; |
;; This file is part of Common development libraries (Libs-Dev). ;; |
;; ;; |
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;; |
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;; |
;; of the License, or (at your option) any later version. ;; |
;; ;; |
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;; |
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; |
;; Lesser General Public License for more details. ;; |
;; ;; |
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev. ;; |
;; If not, see <http://www.gnu.org/licenses/>. ;; |
;; ;; |
;;================================================================================================;; |
O_BINARY = 00000000b |
O_READ = 00000001b |
O_WRITE = 00000010b |
O_CREATE = 00000100b |
O_SHARE = 00001000b |
O_TEXT = 00010000b |
SEEK_SET = 0 |
SEEK_CUR = 1 |
SEEK_END = 2 |
struct FileDateTime |
union |
time dd ? |
struct |
sec db ? |
min db ? |
hour db ? |
ends |
ends |
union |
date dd ? |
struct |
day db ? |
month db ? |
year dw ? |
ends |
ends |
ends |
struct FileInfoBlock |
Function dd ? |
Position dd ? |
Flags dd ? |
Count dd ? |
Buffer dd ? |
db ? |
FileName dd ? |
ends |
struct FileInfoHeader |
Version dd ? |
FilesRead dd ? |
FilesCount dd ? |
rd 5 |
ends |
struct FileInfoA |
Attributes dd ? |
Flags dd ? |
DateCreate FileDateTime |
DateAccess FileDateTime |
DateModify FileDateTime |
union |
FileSize dq ? |
struct |
FileSizeLow dd ? |
FileSizeHigh dd ? |
ends |
ends |
FileName rb 264 |
ends |
struct FileInfoW |
Attributes dd ? |
Flags dd ? |
DateCreate FileDateTime |
DateAccess FileDateTime |
DateModify FileDateTime |
union |
FileSize dq ? |
struct |
FileSizeLow dd ? |
FileSizeHigh dd ? |
ends |
ends |
FileName rw 264 |
ends |
virtual at 0 |
FileInfo FileInfoA |
FileInfo fix FileInfoA |
sizeof.FileInfo fix sizeof.FileInfoA |
end virtual |
FA_READONLY = 00000001b |
FA_HIDDEN = 00000010b |
FA_SYSTEM = 00000100b |
FA_LABEL = 00001000b |
FA_FOLDER = 00010000b |
FA_ARCHIVED = 00100000b |
FA_NORMAL = 01000000b |
FA_ANY = 01111111b |
/programs/macros.inc |
---|
292,7 → 292,8 |
;__CPU_type equ p5 |
SYSENTER_VAR equ 0 |
macro mcall a,b,c,d,e,f { ; mike.dld |
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls |
local ..ret_point |
__mov eax,a |
__mov ebx,b |
__mov ecx,c |
300,7 → 301,30 |
__mov esi,e |
__mov edi,f |
if __CPU_type eq p5 |
int 0x40 |
else |
if __CPU_type eq p6 |
push ebp |
mov ebp, esp |
push ..ret_point ; it may be 2 or 5 byte |
sysenter |
..ret_point: |
pop edx |
pop ecx |
else |
if __CPU_type eq k6 |
push ecx |
syscall |
pop ecx |
else |
display 'ERROR : unknown CPU type (set to p5)', 10, 13 |
__CPU_type equ p5 |
int 0x40 |
end if |
end if |
end if |
} |
503,6 → 527,49 |
Size dq ? |
ends |
if __CPU_type eq p5 ; CMOVcc isnt supported on the P5 |
cmove fix cmovz |
macro cmovz reg1, reg2 { |
local .jumpaddr |
jnz .jumpaddr |
mov reg1, reg2 |
.jumpaddr: |
} |
cmovne fix cmovnz |
macro cmovnz reg1, reg2 { |
local .jumpaddr |
jz .jumpaddr |
mov reg1, reg2 |
.jumpaddr: |
} |
macro cmovg reg1, reg2 { |
local .jumpaddr |
jle .jumpaddr |
mov reg1, reg2 |
.jumpaddr: |
} |
macro cmovl reg1, reg2 { |
local .jumpaddr |
jge .jumpaddr |
mov reg1, reg2 |
.jumpaddr: |
} |
end if |
; constants |
; events |
526,3 → 593,5 |
EVM_MOUSE = 100000b |
EVM_IPC = 1000000b |
EVM_STACK = 10000000b |
EVM_DEBUG = 100000000b |
EVM_STACK2 = 1000000000b |
/programs/network/proc32.inc |
---|
File deleted |
/programs/network/libio.inc |
---|
File deleted |
/programs/network/network.inc |
---|
File deleted |
/programs/network/config.inc |
---|
File deleted |
/programs/network/dll.inc |
---|
File deleted |
/programs/network/macros.inc |
---|
File deleted |
/programs/network/debug-fdo.inc |
---|
File deleted |
/programs/network/struct.inc |
---|
File deleted |
/programs/network/downloader/downloader.asm |
---|
19,7 → 19,7 |
BUFFERSIZE = 4096 |
__DEBUG__ = 1 |
__DEBUG_LEVEL__ = 2 |
__DEBUG_LEVEL__ = 1 |
format binary as "" |
35,12 → 35,12 |
dd params ; I_PARAM |
dd 0x0 ; I_Path |
include '../macros.inc' |
include '../proc32.inc' |
include '../network.inc' |
include '../../macros.inc' |
include '../../proc32.inc' |
include '../../network.inc' |
include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
include '../dll.inc' |
include '../debug-fdo.inc' |
include '../../dll.inc' |
include '../../debug-fdo.inc' |
START: |
/programs/network/ftpd/commands.inc |
---|
531,13 → 531,13 |
stosd |
; now the filesize in ascii |
mov eax, [ebx + FileInfoA.FileSizeLow] |
mov eax, dword[ebx + FileInfoA.FileSize] |
call dword_to_ascii |
mov al, ' ' |
stosb |
; then date (month/day/year) |
movzx eax, [ebx + FileInfoA.DateModify + FileDateTime.month] |
movzx eax, [ebx + FileInfoA.DateModify.month] |
cmp eax, 12 |
ja @f |
mov eax, [months - 4 + 4*eax] |
544,12 → 544,12 |
stosd |
@@: |
movzx eax, [ebx + FileInfoA.DateModify + FileDateTime.day] |
movzx eax, [ebx + FileInfoA.DateModify.day] |
call dword_to_ascii |
mov al, ' ' |
stosb |
movzx eax, [ebx + FileInfoA.DateModify + FileDateTime.year] |
movzx eax, [ebx + FileInfoA.DateModify.year] |
call dword_to_ascii |
mov al, ' ' |
stosb |
/programs/network/ftpd/ftpd.asm |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; ftpd.asm - FTP Daemon for KolibriOS ;; |
63,14 → 63,14 |
dd params ; parameters |
dd path ; path |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../struct.inc' |
include '../libio.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../struct.inc' |
include '../../libio.inc' |
include '../network.inc' |
include '../../network.inc' |
macro sendFTP str { |
local string, length |
/programs/network/icmp/ping.asm |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; ping.asm - ICMP echo client for KolibriOS ;; |
12,9 → 12,10 |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
BUFFERSIZE = 1500 |
use32 |
org 0x0 |
28,13 → 29,12 |
dd 0 ; path |
BUFFERSIZE equ 1500 |
; useful includes |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../network.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../network.inc' |
include 'icmp.inc' |
/programs/network/ircc/ircc.asm |
---|
87,11 → 87,11 |
dd param |
dd path |
include "../macros.inc" |
include "../proc32.inc" |
include "../dll.inc" |
include "../network.inc" |
include "../struct.inc" |
include "../../macros.inc" |
include "../../proc32.inc" |
include "../../dll.inc" |
include "../../network.inc" |
include "../../struct.inc" |
include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
struct window |
426,10 → 426,6 |
scrollbar_v_draw ,'scrollbar_v_draw' ,\ |
scrollbar_v_mouse,'scrollbar_v_mouse' |
usercommand db '/server chat.freenode.net', 0 |
rb MAX_COMMAND_LEN |
I_END: |
; width, left, top |
438,6 → 434,9 |
scroll1 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 1 |
scroll2 scrollbar SCROLLBAR_WIDTH, 300, 150, TOP_Y, 10, 100, 0, 0, 0, 0, 0, 1 |
usercommand db '/server chat.freenode.net', 0 |
rb MAX_COMMAND_LEN |
main_PID dd ? ; identifier of main thread |
utf8_bytes_rest dd ? ; bytes rest in current UTF8 sequence |
utf8_char dd ? ; first bits of current UTF8 character |
/programs/network/netcfg/netcfg.asm |
---|
1,10 → 1,16 |
; |
; Netcfg v1.02 |
; |
; Application to load network drivers in KolibriOS |
; |
; By hidnplayr |
; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; netcfg.asm - Network driver control center for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
21,7 → 27,7 |
type_ethernet equ 1 |
include '../macros.inc' |
include '../../macros.inc' |
START: |
; first, check boot parameters |
243,13 → 249,26 |
@@: mcall 62 ; Read it |
mov [PCI_IRQ], al ; Save it |
; cmp byte [PCI_Class], 0 ; device from before class codes |
; je @f |
cmp byte [PCI_Class], 2 ; network controller |
je @f |
cmp byte [PCI_Class], 2 ; network controller |
cmp byte [PCI_Class], 6 ; bridge type device |
jne nextDev |
; @@: |
cmp byte [PCI_SubClass], 7 ; Cardbus bridge |
jne nextDev |
mov bl, 6 ; get a dword |
mov bh, byte [V_Bus] ; bus of pci device |
mov ch, byte [V_Dev] ; device number/function |
mov cl, 0x40 ; offset to subsystem device/vendor id |
mcall 62 ; get ID's |
mov word [PCI_Device], ax ; There is a device here, save the ID's |
shr eax, 16 ; |
mov word [PCI_Vendor], ax ; |
@@: |
cmp byte[param], 0 |
jne load_and_start |
/programs/network/netstat/netstat.asm |
---|
26,8 → 26,8 |
dd (I_END+0x1000) ; esp |
dd 0, 0 ; I_Param , I_Path |
include '..\macros.inc' |
include '..\network.inc' |
include '../../macros.inc' |
include '../../network.inc' |
START: |
mcall 40, EVM_REDRAW + EVM_BUTTON + EVM_STACK2 |
324,9 → 324,7 |
pop ecx |
mcall |
mov edx, 50 shl 16 + 150 |
; mov edx, 50 shl 16 + 150 |
mov [last], 0 |
.arp_loop: |
/programs/network/nslookup/nslookup.asm |
---|
1,3 → 1,17 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; nslookup.asm - name service lookup (DNS)) program for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
use32 |
12,12 → 26,12 |
dd 0 ; path |
; useful includes |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../network.inc' |
include '../../network.inc' |
; entry point |
start: |
/programs/network/pppoe/pppoe.asm |
---|
1,9 → 1,9 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2012. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; pppoe.asm - PPPoE dialer for KolibriOS ;; |
;; pppoe.asm - PPPoe dialer for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
25,12 → 25,12 |
dd 0 ; parameters |
dd 0 ; path |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../network.inc' |
include '../struct.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../network.inc' |
include '../../struct.inc' |
; Ethernet protocol numbers |
ETHER_PPP_DISCOVERY = 0x6388 |
/programs/network/socketdbg/socketdbg.asm |
---|
1,3 → 1,17 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; socketdbg.asm - socket debug utility for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
use32 |
12,13 → 26,12 |
dd 0 ; path |
; useful includes |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../struct.inc' |
include '../struct.inc' |
include 'socket.inc' |
; entry point |
/programs/network/synergyc/synergyc.asm |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; Synergyc.asm - Synergy client for KolibriOS ;; |
14,6 → 14,9 |
format binary as "" |
BUFFERSIZE = 1024 |
DEFAULTPORT = 24800 |
use32 |
org 0x0 |
26,19 → 29,12 |
dd 0 ; parameters |
dd path ; path |
__DEBUG__ equ 1 ; enable/disable |
__DEBUG_LEVEL__ equ 1 ; 1 = all, 2 = errors |
BUFFERSIZE equ 1024 |
DEFAULTPORT equ 24800 |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../network.inc' |
include '../../network.inc' |
start: |
68,15 → 64,9 |
push 80 |
call [con_init] |
push path |
push str0 |
call [con_write_asciiz] |
push newline |
call [con_write_asciiz] |
push newline |
call [con_write_asciiz] |
invoke ini.get_str, path, str_remote, str_ip, buffer_ptr, 16, 0 |
test eax, eax |
jnz error |
97,13 → 87,22 |
mcall socket, AF_INET4, SOCK_STREAM, 0 |
cmp eax, -1 |
je error |
mov [socketnum], eax |
; resolve name |
push esp ; reserve stack place |
push esp ; ptr to result |
push 0 ; addrinfo hints |
push 0 ; servname |
push buffer_ptr ; hostname |
call [inet_addr] |
cmp eax, -1 |
je error |
call [getaddrinfo] |
pop esi |
; test for error |
test eax, eax |
jnz error |
mov eax, [esi+addrinfo.ai_addr] |
mov eax, [eax+sockaddr_in.sin_addr] |
mov [sockaddr1.ip], eax |
mcall connect, [socketnum], sockaddr1, 18 |
111,7 → 110,7 |
push str7 |
call [con_write_asciiz] |
mcall 40, 1 shl 7; + 7 |
mcall 40, EVM_STACK |
login: |
call wait_for_data |
273,12 → 272,14 |
push str_err |
call [con_write_asciiz] |
call [con_gets] |
; call [con_gets] |
call [con_getch2] |
mcall close, [socketnum] |
push 1 |
call [con_exit] |
mcall close, [socketnum] |
exit: |
mcall -1 |
292,7 → 293,7 |
je wait_for_data |
cmp eax, 8 |
jl wait_for_data |
jb wait_for_data ; FIXME |
ret |
300,15 → 301,16 |
; data |
title db 'Synergy client',0 |
str0 db 'Welcome to the software KM switch for KolibriOS.',10,10,0 |
str1 db 'Connecting to: ',0 |
str7 db 'Connected!',13,10,0 |
str2 db 13,10,'Handshake received',13,10,0 |
str7 db 'Connected!',10,0 |
str2 db 10,'Handshake received',10,0 |
str3 db 'Unsupported command: ',0 |
newline db 13,10,0 |
str4 db 'mouse moved',13,10,0 |
str5 db 'mouse buttons changed',13,10,0 |
str6 db 'Enter screen',13,10,0 |
str_err db 'Error occured !',13,10,'Press any key to quit',0 |
newline db 10,0 |
str4 db 'mouse moved',10,0 |
str5 db 'mouse buttons changed',10,0 |
str6 db 'Enter screen',10,0 |
str_err db 'Uh-Oh.. some error occured !',10,'Press any key to quit.',0 |
screeninfo: |
dd (screeninfo.length - 4) shl 24 |
360,7 → 362,7 |
libini, 'libini.obj' |
import network,\ |
inet_addr, 'inet_addr' |
getaddrinfo, 'getaddrinfo' |
import console, \ |
con_start, 'START',\ |
/programs/network/tcpserv/tcpserv.asm |
---|
1,5 → 1,21 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; tcpserv.asm - TCP demo program for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
BUFFERSIZE = 1500 |
use32 |
; standard header |
db 'MENUET01' ; signature |
12,14 → 28,12 |
dd 0 ; path |
BUFFERSIZE equ 1500 |
; useful includes |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../network.inc' |
include '../../network.inc' |
; entry point |
start: |
/programs/network/telnet/telnet.asm |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; telnet.asm - Telnet client for KolibriOS ;; |
14,9 → 14,9 |
format binary as "" |
__DEBUG__ equ 0 |
__DEBUG_LEVEL__ equ 1 |
BUFFERSIZE equ 4096 |
__DEBUG__ = 0 |
__DEBUG_LEVEL__ = 1 |
BUFFERSIZE = 4096 |
use32 |
; standard header |
29,12 → 29,12 |
dd hostname ; parameters |
dd 0 ; path |
include '../macros.inc' |
include '../../macros.inc' |
purge mov,add,sub |
include '../proc32.inc' |
include '../dll.inc' |
include '../debug-fdo.inc' |
include '../network.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../debug-fdo.inc' |
include '../../network.inc' |
; entry point |
start: |
/programs/network/tftpc/tftpc.asm |
---|
1,3 → 1,17 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; tftpc.asm - TFTP client for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
use32 |
7,32 → 21,29 |
dd 0x1 |
dd START |
dd I_END |
dd IM_END |
dd IM_END |
dd IM_END+0x1000 |
dd IM_END+0x1000 |
dd 0, 0 |
include '../proc32.inc' |
include '../macros.inc' |
include '../libio.inc' |
include '../dll.inc' |
include '../../proc32.inc' |
include '../../macros.inc' |
include '../../libio.inc' |
include '../../dll.inc' |
include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
include '../network.inc' |
include '../../network.inc' |
filebuffer_size equ 4*4096 ; 16kb (dont try to change it yet..) |
TIMEOUT equ 100 |
buffer_len equ 1500 |
filebuffer_size = 4*4096 ; 16kb (dont try to change it yet..) |
TIMEOUT = 100 |
buffer_len = 1500 |
AF_INET4 equ 2 |
IP_PROTO_UDP equ 17 |
opcode_rrq = 1 |
opcode_wrq = 2 |
opcode_data = 3 |
opcode_ack = 4 |
opcode_error = 5 |
opcode_rrq equ 1 |
opcode_wrq equ 2 |
opcode_data equ 3 |
opcode_ack equ 4 |
opcode_error equ 5 |
; read/write request packet |
; |
; 2 bytes string 1 byte string 1 byte |
561,6 → 572,4 |
buffer: |
rb buffer_len |
rb 0x1000 ; stack |
IM_END: |
/programs/network/vncc/vncc.asm |
---|
1,12 → 1,28 |
; |
; |
; VNC Client for kolibrios by hidnplayr |
; |
; hidnplayr@gmail.com |
; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; vncc.asm - VNC client for KolibriOS ;; |
;; ;; |
;; Written by hidnplayr@kolibrios.org ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
format binary as "" |
__DEBUG__ = 1 |
__DEBUG_LEVEL__ = 1 |
STRLEN = 64 ; password and server max length |
xpos = 4 ; coordinates of image |
ypos = 22 ; |
TIMEOUT = 5 ; timeout in seconds |
use32 |
org 0x0 |
19,22 → 35,14 |
dd IM_END ; esp |
dd 0x0 , 0x0 ; I_Param , I_Path |
__DEBUG__ equ 1 |
__DEBUG_LEVEL__ equ 1 |
STRLEN = 64 ; password and server max length |
xpos = 4 ; coordinates of image |
ypos = 22 ; |
include '../../macros.inc' |
include '../../debug-fdo.inc' |
include '../../proc32.inc' |
include '../../dll.inc' |
include '../../struct.inc' |
include '../../network.inc' |
TIMEOUT = 5 ; timeout in seconds |
include '../macros.inc' |
include '../debug-fdo.inc' |
include '../proc32.inc' |
include '../dll.inc' |
include '../struct.inc' |
include '../network.inc' |
include 'structs.inc' |
include 'logon.inc' |
include 'raw.inc' |
/programs/network/zeroconf/zeroconf.asm |
---|
9,7 → 9,7 |
;; Some code contributed by Derpenguin ;; |
;; ;; |
;; DHCP code is based on that by Mike Hibbet ;; |
; (DHCP client for menuetos) ;; |
;; (DHCP client for menuetos) ;; |
;; ;; |
;; GNU GENERAL PUBLIC LICENSE ;; |
;; Version 2, June 1991 ;; |
18,17 → 18,6 |
format binary as "" |
use32 |
org 0x0 |
db 'MENUET01' ; 8 byte id |
dd 0x01 ; header version |
dd START ; start of code |
dd IM_END ; size of image |
dd (I_END+0x100) ; memory for app |
dd (I_END+0x100) ; esp |
dd 0, 0 ; I_Param, I_Path |
; CONFIGURATION |
TIMEOUT = 60 ; in seconds |
53,13 → 42,24 |
DEFEND_INTERVAL = 10 ; seconds (min. wait between defensive ARPs) |
use32 |
org 0x0 |
include '../proc32.inc' |
include '../macros.inc' |
include '../debug-fdo.inc' |
include '../network.inc' |
db 'MENUET01' ; 8 byte id |
dd 0x01 ; header version |
dd START ; start of code |
dd IM_END ; size of image |
dd (I_END+0x100) ; memory for app |
dd (I_END+0x100) ; esp |
dd 0, 0 ; I_Param, I_Path |
include '../../proc32.inc' |
include '../../macros.inc' |
include '../../debug-fdo.inc' |
include '../../network.inc' |
include 'dhcp.inc' |
include '../dll.inc' |
include '../../dll.inc' |
Ip2dword: |
/programs/network.inc |
---|
0,0 → 1,94 |
; Socket types |
SOCK_STREAM = 1 |
SOCK_DGRAM = 2 |
SOCK_RAW = 3 |
; Socket options |
SO_NONBLOCK = 1 shl 31 |
; IP protocols |
IPPROTO_IP = 0 |
IPPROTO_ICMP = 1 |
IPPROTO_TCP = 6 |
IPPROTO_UDP = 17 |
; Address families |
AF_UNSPEC = 0 |
AF_LOCAL = 1 |
AF_INET4 = 2 ; IPv4 |
AF_INET6 = 28 ; IPv6 (not supported yet) |
PF_UNSPEC = AF_UNSPEC |
PF_LOCAL = AF_LOCAL |
PF_INET4 = AF_INET4 |
PF_INET6 = AF_INET6 |
; Flags for addrinfo |
AI_PASSIVE = 1 |
AI_CANONNAME = 2 |
AI_NUMERICHOST = 4 |
AI_NUMERICSERV = 8 |
AI_ADDRCONFIG = 0x400 |
; internal definition |
AI_SUPPORTED = 0x40F |
; for system function 76 |
API_ETH = 0 shl 16 |
API_IPv4 = 1 shl 16 |
API_ICMP = 2 shl 16 |
API_UDP = 3 shl 16 |
API_TCP = 4 shl 16 |
API_ARP = 5 shl 16 |
API_PPPOE = 6 shl 16 |
struct sockaddr_in |
sin_family dw ? ; sa_family_t |
sin_port dw ? ; in_port_t |
sin_addr dd ? ; struct in_addr |
sin_zero rb 8 ; zero |
ends |
struct addrinfo |
ai_flags dd ? ; bitmask of AI_* |
ai_family dd ? ; PF_* |
ai_socktype dd ? ; SOCK_* |
ai_protocol dd ? ; 0 or IPPROTO_* |
ai_addrlen dd ? ; length of ai_addr |
ai_canonname dd ? ; char* |
ai_addr dd ? ; struct sockaddr* |
ai_next dd ? ; struct addrinfo* |
ends |
EAI_ADDRFAMILY = 1 |
EAI_AGAIN = 2 |
EAI_BADFLAGS = 3 |
EAI_FAIL = 4 |
EAI_FAMILY = 5 |
EAI_MEMORY = 6 |
EAI_NONAME = 8 |
EAI_SERVICE = 9 |
EAI_SOCKTYPE = 10 |
EAI_BADHINTS = 12 |
EAI_PROTOCOL = 13 |
EAI_OVERFLOW = 14 |
socket fix 75, 0 |
close fix 75, 1 |
bind fix 75, 2 |
listen fix 75, 3 |
connect fix 75, 4 |
accept fix 75, 5 |
send fix 75, 6 |
recv fix 75, 7 |
setsockopt fix 75, 8 |
getsockopt fix 75, 9 |
socketpair fix 75, 10 |
struct ARP_entry |
IP dd ? |
MAC dp ? |
status dw ? |
TTL dw ? |
ends |