Subversion Repositories Kolibri OS

Rev

Rev 647 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
609 andrew_pro 1
format ELF
2
section '.text' executable
3
 
4
public console_init
5
public console_printf
6
public console_exit
7
 
8
align 4
9
console_init:
10
 
6410 siemargl 11
	pushad
609 andrew_pro 12
 
6410 siemargl 13
	mov eax,[console_init_status]
14
	test eax,eax
15
	jnz console_initializated
609 andrew_pro 16
 
6410 siemargl 17
	mov [console_init_status],1
609 andrew_pro 18
 
6410 siemargl 19
	mov eax,68
20
	mov ebx,19
21
	mov ecx,console_path
22
	int 0x40
609 andrew_pro 23
 
6410 siemargl 24
	test eax,eax
25
	jz console_not_loaded
609 andrew_pro 26
 
6410 siemargl 27
		mov ebx,[eax+4]
28
		mov [con_start],ebx
609 andrew_pro 29
 
6410 siemargl 30
		mov ebx,[eax+4+16]
31
		mov [con_init],ebx
609 andrew_pro 32
 
6410 siemargl 33
		mov ebx,[eax+4+32]
34
		mov [con_printf],ebx
609 andrew_pro 35
 
6410 siemargl 36
		push 1
37
		call [con_start]
609 andrew_pro 38
 
6410 siemargl 39
		push caption
40
		push -1
41
		push -1
42
		push -1
43
		push -1
44
		call [con_init]
609 andrew_pro 45
 
6410 siemargl 46
	console_not_loaded:
609 andrew_pro 47
 
6410 siemargl 48
	console_initializated:
609 andrew_pro 49
 
6410 siemargl 50
	popad
609 andrew_pro 51
 
6410 siemargl 52
	ret
609 andrew_pro 53
 
54
align 4
55
console_printf:
56
 
6410 siemargl 57
	pop [return_addres]
609 andrew_pro 58
 
6410 siemargl 59
	call [con_printf]
60
	;add esp,8
609 andrew_pro 61
 
6410 siemargl 62
	push [return_addres]
609 andrew_pro 63
 
6410 siemargl 64
	ret
609 andrew_pro 65
 
66
align 4
67
console_exit:
68
 
6410 siemargl 69
	push 0
70
	call [con_exit]
609 andrew_pro 71
 
6410 siemargl 72
	ret
609 andrew_pro 73
 
74
 
75
;-----------------------------
76
console_path db '/sys/dll/console.obj',0
77
caption      db 'Console',0
78
 
79
align 4
6410 siemargl 80
con_start		  rd 1
81
con_init		  rd 1
82
con_printf		  rd 1
83
con_exit		  rd 1
84
console_init_status	  rd 1
85
return_addres		  rd 1