;================================================================================= ; KDSETLED, KDMKTONE demonstration. ; ; Turns on all three LED's and beeps. ; ; The LSCR Project. ;================================================================================= format ELF include '../macros.inc' include '../../include/symbols.inc' include '../../include/structs.inc' extrn error_chk section '.text' executable public _start _start: mov eax, SYS_OPEN ; open '/dev/console' mov ebx, filename_s mov ecx, O_WRONLY mov edx, S_IWUSR int 0x80 ccall error_chk, <"SYS_OPEN has failed: ">, exit mov [file_d], eax mov eax, SYS_IOCTL ; turn on the leds mov ebx, [file_d] mov ecx, KDSETLED mov edx, LED_NUM or LED_CAP or LED_SCR int 0x80 ccall error_chk, <"KDSETLED has failed: ">, close mov eax, SYS_IOCTL ; generate tone mov ebx, [file_d] mov ecx, KDMKTONE mov edx, (125 shl 16) + 1591 ; this is the default 'beep' tone int 0x80 ccall error_chk, <"KDMKTONE has failed: ">, close close: mov eax, SYS_CLOSE mov ebx, [file_d] int 0x80 exit: mov eax, SYS_EXIT xor ebx, ebx int 0x80 section '.data' writeable filename_s db "/dev/console",0 file_d rd 1