summaryrefslogtreecommitdiff
path: root/main.s
diff options
context:
space:
mode:
Diffstat (limited to 'main.s')
-rw-r--r--main.s48
1 files changed, 30 insertions, 18 deletions
diff --git a/main.s b/main.s
index 241d3fc..a548e94 100644
--- a/main.s
+++ b/main.s
@@ -74,6 +74,7 @@ DRAWCELL_ARGLEN = 8 + BYTES_PER_PIXEL
.equ M_MMAP, 0002
.equ M_ICANON, 0004
.equ M_GRAPHICS, 0010
+.equ M_FBOPEN, 0020
.text
.globl _start
@@ -159,40 +160,40 @@ _start:
cmpl $0, %eax
jl open_error
- orb $M_OPEN, (prog_mode)
+ movl %eax, (fbctl)
- subl $200, %esp
- movl %eax, (desc)
+ orb $M_FBOPEN, (prog_mode)
# get frame buffer screeninfo
movl %eax, %ebx
movl $SYS_IOCTL, %eax
movl $FBIOGET_VSCREENINFO, %ecx
- movl %esp, %edx
+ movl $fbi, %edx
int $0x80
testl %eax, %eax
jnz ioctl_error
- movl %esp, %esi
+ movl $fbi, %esi
movl $fbx, %edi
movsl
movl $fby, %edi
movsl
- addl $200, %esp
movl (fbx), %eax
mull (fby)
shll $BPP_SHIFT, %eax
movl %eax, (fbsize)
+ orl $(FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE), (fbi + FB_ACTIVATE)
+
# mmap fbdev into memory
pushl $0
- pushl (desc)
+ pushl (fbctl)
pushl $MAP_SHARED
- pushl $(PROT_READ | PROT_WRITE)
+ pushl $PROT_WRITE
pushl (fbsize)
pushl $0
movl $SYS_MMAP, %eax
@@ -209,12 +210,6 @@ _start:
addl $24, %esp
orb $M_MMAP, (prog_mode)
- movl $SYS_CLOSE, %eax
- movl (desc), %ebx
- int $0x80
-
- andb $~M_OPEN, (prog_mode)
-
# set signal handlers
xorl %edx, %edx
@@ -595,6 +590,15 @@ store_val:
testl %edx, %edx
jnz 1b
+ movl $SYS_IOCTL, %eax
+ movl (fbctl), %ebx
+ movl $FBIOPUT_VSCREENINFO, %ecx
+ movl $fbi, %edx
+ int $0x80
+
+ testl %eax, %eax
+ jnz ioctl_error
+
jmp life_loop
event_handler:
@@ -605,7 +609,7 @@ event_handler:
testb $EV_RESTART, %al
jnz read_file
testb $EV_PRINT, %al
- jnz export
+ jnz resume
# is case when life is started, when its virtual terminal is nonactive
# when this vt activated, process recieve SIGUSR2 signal
@@ -646,14 +650,20 @@ restore:
.rest_open:
testb $M_OPEN, (prog_mode)
- jz exit
+ jz .rest_fbopen
movl $SYS_CLOSE, %eax
movl (desc), %ebx
int $0x80
-export:
- jmp resume
+.rest_fbopen:
+ testb $M_FBOPEN, (prog_mode)
+ jz exit
+
+ movl $SYS_CLOSE, %eax
+ movl (fbctl), %ebx
+ int $0x80
+
exit:
movl %eax, %ebx
@@ -1025,9 +1035,11 @@ timespec:
.bss
.comm desc, 4
+.comm fbctl, 4
.comm fbmem, 4
.comm fbsize, 4
.comm life_map, TOTAL_EXT
+.comm fbi, 256
.comm fbx, 4
.comm fby, 4
.comm curx, 4