StupidOS/kernel/dev/dev.inc

57 lines
650 B
PHP
Raw Normal View History

2024-07-14 13:11:28 +00:00
;; File: dev.inc
struc Device {
2024-07-17 07:41:36 +00:00
.name db 8 dup(?)
.init dd ?
2024-07-14 13:11:28 +00:00
}
2024-07-16 07:52:08 +00:00
DEFN Device
2024-07-17 07:41:36 +00:00
struc BlkDev {
.open dd ?
.close dd ?
.strategy dd ?
.ioctl dd ?
.close dd ?
.dump dd ?
.psize dd ?
}
struc CharDev {
.open dd ?
.close dd ?
.read dd ?
.write dd ?
.ioctl dd ?
.select dd ?
.stop dd ?
.mmap dd ?
.reset dd ?
}
aBlockDevices:
dd 10 dup(0)
.end:
aCharDevices:
dd 10 dup(0)
.end:
2024-07-16 07:52:08 +00:00
aDevices:
dd floppy_device
2024-07-17 07:41:36 +00:00
dd kbd_device
dd console_device
2024-07-16 07:52:08 +00:00
.end:
2024-07-14 13:11:28 +00:00
2024-07-16 06:29:16 +00:00
dev_init:
2024-07-16 07:52:08 +00:00
mov ecx, aDevices
@@:
mov eax, [ecx]
2024-07-17 07:41:36 +00:00
mov eax, [eax + Device.init]
2024-07-16 07:52:08 +00:00
push ecx
call eax
pop ecx
add ecx, 4
cmp ecx, aDevices.end
jb @b
2024-07-16 06:29:16 +00:00
ret