]> wirehaze git hosting - BOS.git/blob - doc/services.txt

wirehaze git hosting

Some cleanup, service design document draft
[BOS.git] / doc / services.txt
1 SYSTEM SERVICES LAYOUT
2 ======================
3
4 All OS functionality can be reached from one or several
5 interfaces/services.
6
7 When calling the system interrupt 0x32, you request a service
8 number and function in AX register with AL & AH. Making 256 the max
9 number of interfaces and available service-functions.
10
11 Services numbered 0x0F and below are system reserved and will not be
12 assigned automatically when requesting to add a new service. They can
13 still be replaced by implicitly requesting that service number instead
14 of getting a free one assigned.
15
16 This will allow for great OS modularity when each interface/service-
17 group can be replaced or upgraded by any user software or driver.
18
19 Most service groups or interfaces can be extended with drivers for
20 the type of device(s) that it handles, or the full service/interface
21 can be replaced for more fundamental changes to the design. For
22 example the 'process' and 'memory' interfaces can be replaced to
23 allow more advanced functionality like multitasking and paging.
24
25 The OS will be unable to function at all without the basic service
26 0x00 that performs the most crucial tasks, and without the STDIO and
27 VFS interfaces it will be severly crippled, left with no means of
28 communication, except perhaps a beep or two from the PC-speaker.
29
30 Below is a more visual representation of the main OS services
31 that will likely be included in the kernel. And a draft of what
32 functions each could or would include. Some functions also have
33 a breif example of parameters required.
34
35 Possible funture service groups or interfaces that could be system
36 default include:
37 - network functionality
38 - general PCI devices
39 - special one for all things USB?
40 - GUI specific functions
41 - running stuff in 16 and 64 bit, with extra DOS emulation
42 and/or other services
43
44
45
46
47 services.asm (main service 0x00)
48 --------------------------------------
49 always present in BOS, kernel
50 --------------------------------------
51 - add service
52 signature dd 'VFS ', 'IO ', 'SND ', 'PCI '
53 version db 1
54 requested_no db 23 ; 0xFF or 0x00 to get assigned
55 service_struct dd 0 ; memory address of service calltable
56 - get servide
57 AL = number
58 returns all info above if service found
59 - remove service
60 AL = number
61 removes / unloads a service/interface
62 - get free number
63 AL = free service number ; always above 0x0F (below reserved)
64 - get BOS version (and other misc. kernel functions below)
65 - get/set interrupts
66 - execute kernel monitor command/script
67 - get time/date
68 - DMA functions, here or in VFS/floppy/memory drivers?
69 - GDT function, create new segments 'n shit
70 - pc-speaker beep if not even stdio is found
71 - CMOS / PIC functions
72 - run 16/64 bit code - seperate services for this? (int21h included?)
73 - get specified...
74
75
76 stdio.asm (service number 0x01)
77 --------------------------------------
78 needs to init itself as a service,
79 requesting servicenumber 1.
80 internal struct with info on
81 default in and out devices.
82 --------------------------------------
83 - add device
84 type db 1 ; 0 = output, 1 = input
85 signature dd 'COM ', 'VGA ', 'VESA', 'FILE', 'NET ', 'USB ', 'KEYB', 'MICE'
86 version db 1
87 device_struct dd 0 ; address of calltable
88 - get device
89 AL = assigned device type ID / 0 for default?
90 returns all info above
91 - remove device
92 AL = assigned device type ID
93 removes device
94 - set default
95 AL = assigned device type ID
96 AH = 1 for in, 0 for out
97 - getc
98 get a char from stdin or specified device
99 - putc
100 put a char to stdout or specified device
101
102 .... other default stubs needed for STDIO ....
103
104
105 vfs.asm (service number 0x02)
106 --------------------------------------
107 needs to init itself as a service,
108 requesting servicenumber 2.
109 internal struct with info on
110 devices and filesystems.
111 add simple 'FILE' STDIO interface?
112 --------------------------------------
113 - add device
114 - remove device
115 - get devices (list or number specified)
116 - read sector
117 - write sector
118 - seek
119 - more device specific stubs?
120 ...
121 - add fs
122 - remove fs
123 - parse path
124 - load file
125 - write file
126 - seek file
127 - close file
128 - mount device (with auto detect fs option)
129 - format fs (take device argument)
130 - more fs specific stubs?
131
132
133 proccess.asm (service number 0x03)
134 --------------------------------------
135 needs to init itself as a service,
136 requesting servicenumber 3.
137 possible to extend/replace for
138 multitasking.
139 --------------------------------------
140 - Load process
141 needs VFS info to load file
142 - Exit process
143 - Terminate and Stay Resident
144 - Add exec. driver
145 interface to load driver/extensions for
146 more executable formats, possibly other
147 execution modes: realmode, longmode
148 - Remove driver
149
150
151 memory.asm (service number 0x04)
152 --------------------------------------
153 needs to init itself as a service,
154 requesting servicenumber 4.
155 --------------------------------------
156 - lowalloc ? (for low mem, DMA & 16bit code)
157 - alloc
158 - realloc
159 - free
160 - DMA functions here? Possibly most related to mem?