StupidOS/kernel/dev/dev.inc

70 lines
887 B
PHP
Raw Normal View History

2024-07-14 13:11:28 +00:00
;; File: dev.inc
2024-07-21 16:14:38 +00:00
include 'at/cmos.inc'
include 'at/com.inc'
include 'at/ne2k.inc'
include 'at/pit.inc'
include 'at/kbd.inc'
include 'at/cga.inc'
2024-07-22 21:43:35 +00:00
include 'at/ata.inc'
2024-07-21 16:14:38 +00:00
include 'at/floppy.inc'
2024-07-14 13:11:28 +00:00
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 ?
.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:
2024-07-21 16:14:38 +00:00
dd floppy_bdevsw
2024-07-17 07:41:36 +00:00
.end:
aCharDevices:
2024-07-21 16:14:38 +00:00
dd console_cdevws
dd com_cdevsw
2024-07-17 07:41:36 +00:00
.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-19 07:53:03 +00:00
dd com_device
dd ne2k_device
2024-07-22 21:43:35 +00:00
dd ata_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