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

wirehaze git hosting

Added Gitter badge
[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 - printing services
42 - running stuff in 16 and 64 bit, with extra DOS emulation
43 and/or other services
44
45
46
47
48 services.asm (main service 0x00)
49 --------------------------------------
50 always present in BOS, kernel
51 --------------------------------------
52 - add service
53 signature dd 'VFS ', 'IO ', 'SND ', 'PCI '
54 version db 1
55 requested_no db 23 ; 0xFF or 0x00 to get assigned
56 service_struct dd 0 ; memory address of service calltable
57 - get servide
58 AL = number
59 returns all info above if service found
60 - remove service
61 AL = number
62 removes / unloads a service/interface
63 - get free number
64 AL = free service number ; always above 0x0F (below reserved)
65 - get BOS version (and other misc. kernel functions below)
66 - get/set interrupts
67 - execute kernel monitor command/script
68 - get time/date
69 - GDT function, create new segments 'n shit
70 - pc-speaker beep if not even stdio is found
71 - CMOS / PIC functions
72
73
74 stdio.asm (service number 0x01)
75 --------------------------------------
76 needs to init itself as a service,
77 requesting servicenumber 1.
78 internal struct with info on
79 default in and out devices.
80 --------------------------------------
81 - add device
82 type db 1 ; 0 = output, 1 = input
83 signature dd 'COM ', 'VGA ', 'VESA', 'FILE', 'NET ', 'USB ', 'KEYB', 'MICE'
84 version db 1
85 device_struct dd 0 ; address of calltable
86 - get device
87 AL = assigned device type ID / 0 for default?
88 returns all info above
89 - remove device
90 AL = assigned device type ID
91 removes device
92 - set default
93 AL = assigned device type ID
94 AH = 1 for in, 0 for out
95 - getc
96 get a char from stdin or specified device
97 - putc
98 put a char to stdout or specified device
99
100 .... other default stubs needed for STDIO ....
101
102
103 vfs.asm (service number 0x02)
104 --------------------------------------
105 needs to init itself as a service,
106 requesting servicenumber 2.
107 internal struct with info on
108 devices and filesystems.
109 add simple 'FILE' STDIO interface?
110 --------------------------------------
111 - add device
112 - remove device
113 - get devices (list or number specified)
114 - read sector
115 - write sector
116 - seek
117 - more device specific stubs?
118 ...
119 - add fs
120 - remove fs
121 - parse path
122 - load file
123 - write file
124 - seek file
125 - close file
126 - mount device (with auto detect fs option)
127 - format fs (take device argument)
128 - more fs specific stubs?
129
130
131 proccess.asm (service number 0x03)
132 --------------------------------------
133 needs to init itself as a service,
134 requesting servicenumber 3.
135 possible to extend/replace for
136 multitasking.
137 --------------------------------------
138 - Load process
139 needs VFS info to load file
140 - Exit process
141 - Terminate and Stay Resident
142 - Add exec. driver
143 interface to load driver/extensions for
144 more executable formats, possibly other
145 execution modes: realmode, longmode
146 - Remove driver
147 - run 16/64 bit code - seperate services for this? (int21h included?)
148
149
150 memory.asm (service number 0x04)
151 --------------------------------------
152 needs to init itself as a service,
153 requesting servicenumber 4.
154 --------------------------------------
155 - lowalloc ? (for low mem, DMA & 16bit code)
156 - alloc
157 - realloc
158 - free
159 - DMA functions here? Possibly most related to mem?