Skip to content

Commit 116f5e7

Browse files
committed
Docs: Change comment styles
1 parent 425021f commit 116f5e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+602
-198
lines changed

Diff for: README.md

+223
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,229 @@ This project is a tiny *Intel x86* operating system written in *assembly* and *C
6666

6767
- [*《操作系统真象还原》郑钢*](https://github.com/yifengyou/os-elephant)
6868

69+
## Structure
70+
71+
```console
72+
.
73+
├── CITATION.cff
74+
├── Debugging.md
75+
├── LICENSE
76+
├── Makefile
77+
├── README.md
78+
├── docs
79+
│   ├── Boot
80+
│   │   ├── Images
81+
│   │   │   └── loader
82+
│   │   │   ├── memory-paging.drawio
83+
│   │   │   ├── memory-paging.svg
84+
│   │   │   ├── page-directory-table.drawio
85+
│   │   │   └── page-directory-table.svg
86+
│   │   ├── Loader.md
87+
│   │   └── Master Boot Record.md
88+
│   ├── Getting Started
89+
│   │   ├── Building the System.md
90+
│   │   └── Development Environment.md
91+
│   ├── Kernel
92+
│   │   ├── File System.md
93+
│   │   ├── Images
94+
│   │   │   ├── file-system
95+
│   │   │   │   ├── directory-entries.drawio
96+
│   │   │   │   ├── directory-entries.svg
97+
│   │   │   │   ├── index-node.drawio
98+
│   │   │   │   └── index-node.svg
99+
│   │   │   ├── memory
100+
│   │   │   │   ├── memory-heap.drawio
101+
│   │   │   │   ├── memory-heap.svg
102+
│   │   │   │   ├── memory-pools.drawio
103+
│   │   │   │   └── memory-pools.svg
104+
│   │   │   └── threads
105+
│   │   │   ├── thread-block.drawio
106+
│   │   │   ├── thread-block.svg
107+
│   │   │   ├── thread-lists.drawio
108+
│   │   │   ├── thread-lists.svg
109+
│   │   │   ├── thread-switching.drawio
110+
│   │   │   └── thread-switching.svg
111+
│   │   ├── Interrupts.md
112+
│   │   ├── Memory.md
113+
│   │   ├── System Calls.md
114+
│   │   ├── Threads.md
115+
│   │   └── User Processes.md
116+
│   └── badges
117+
│   ├── C++.svg
118+
│   ├── License-MIT.svg
119+
│   ├── Linux.svg
120+
│   ├── Made-with-GitHub-Actions.svg
121+
│   ├── Made-with-Make.svg
122+
│   └── NASM.svg
123+
├── include
124+
│   ├── boot
125+
│   │   └── boot.inc
126+
│   ├── kernel
127+
│   │   ├── debug
128+
│   │   │   └── assert.h
129+
│   │   ├── descriptor
130+
│   │   │   ├── desc.h
131+
│   │   │   ├── desc.inc
132+
│   │   │   └── gdt
133+
│   │   │   ├── idx.h
134+
│   │   │   └── tab.h
135+
│   │   ├── interrupt
136+
│   │   │   ├── intr.h
137+
│   │   │   └── pic.h
138+
│   │   ├── io
139+
│   │   │   ├── disk
140+
│   │   │   │   ├── disk.h
141+
│   │   │   │   ├── disk.inc
142+
│   │   │   │   ├── file
143+
│   │   │   │   │   ├── dir.h
144+
│   │   │   │   │   ├── file.h
145+
│   │   │   │   │   ├── inode.h
146+
│   │   │   │   │   └── super_block.h
147+
│   │   │   │   └── ide.h
148+
│   │   │   ├── file
149+
│   │   │   │   ├── dir.h
150+
│   │   │   │   ├── file.h
151+
│   │   │   │   └── path.h
152+
│   │   │   ├── io.h
153+
│   │   │   ├── keyboard.h
154+
│   │   │   ├── timer.h
155+
│   │   │   └── video
156+
│   │   │   ├── console.h
157+
│   │   │   ├── print.h
158+
│   │   │   └── print.inc
159+
│   │   ├── krnl.h
160+
│   │   ├── krnl.inc
161+
│   │   ├── memory
162+
│   │   │   ├── page.h
163+
│   │   │   ├── page.inc
164+
│   │   │   └── pool.h
165+
│   │   ├── process
166+
│   │   │   ├── elf.inc
167+
│   │   │   ├── proc.h
168+
│   │   │   └── tss.h
169+
│   │   ├── selector
170+
│   │   │   ├── sel.h
171+
│   │   │   └── sel.inc
172+
│   │   ├── stl
173+
│   │   │   ├── algorithm.h
174+
│   │   │   ├── array.h
175+
│   │   │   ├── cerron.h
176+
│   │   │   ├── cmath.h
177+
│   │   │   ├── cstddef.h
178+
│   │   │   ├── cstdint.h
179+
│   │   │   ├── cstdlib.h
180+
│   │   │   ├── cstring.h
181+
│   │   │   ├── iterator.h
182+
│   │   │   ├── mutex.h
183+
│   │   │   ├── semaphore.h
184+
│   │   │   ├── source_location.h
185+
│   │   │   ├── span.h
186+
│   │   │   ├── string_view.h
187+
│   │   │   ├── type_traits.h
188+
│   │   │   └── utility.h
189+
│   │   ├── syscall
190+
│   │   │   └── call.h
191+
│   │   ├── thread
192+
│   │   │   ├── sync.h
193+
│   │   │   └── thd.h
194+
│   │   └── util
195+
│   │   ├── bit.h
196+
│   │   ├── bitmap.h
197+
│   │   ├── block_queue.h
198+
│   │   ├── format.h
199+
│   │   ├── metric.h
200+
│   │   ├── metric.inc
201+
│   │   └── tag_list.h
202+
│   └── user
203+
│   ├── io
204+
│   │   ├── file
205+
│   │   │   ├── dir.h
206+
│   │   │   └── file.h
207+
│   │   └── video
208+
│   │   └── console.h
209+
│   ├── memory
210+
│   │   └── pool.h
211+
│   ├── process
212+
│   │   └── proc.h
213+
│   ├── stl
214+
│   │   └── cstdint.h
215+
│   └── syscall
216+
│   └── call.h
217+
└── src
218+
├── boot
219+
│   ├── loader.asm
220+
│   └── mbr.asm
221+
├── kernel
222+
│   ├── debug
223+
│   │   └── assert.cpp
224+
│   ├── descriptor
225+
│   │   ├── desc.asm
226+
│   │   └── gdt
227+
│   │   └── tab.cpp
228+
│   ├── interrupt
229+
│   │   ├── intr.asm
230+
│   │   ├── intr.cpp
231+
│   │   └── pic.cpp
232+
│   ├── io
233+
│   │   ├── disk
234+
│   │   │   ├── disk.cpp
235+
│   │   │   ├── file
236+
│   │   │   │   ├── dir.cpp
237+
│   │   │   │   ├── file.cpp
238+
│   │   │   │   ├── inode.cpp
239+
│   │   │   │   └── super_block.cpp
240+
│   │   │   ├── ide.cpp
241+
│   │   │   └── part.cpp
242+
│   │   ├── file
243+
│   │   │   ├── dir.cpp
244+
│   │   │   ├── file.cpp
245+
│   │   │   └── path.cpp
246+
│   │   ├── io.asm
247+
│   │   ├── io.cpp
248+
│   │   ├── keyboard.cpp
249+
│   │   ├── timer.cpp
250+
│   │   └── video
251+
│   │   ├── console.cpp
252+
│   │   ├── print.asm
253+
│   │   └── print.cpp
254+
│   ├── krnl.cpp
255+
│   ├── main.cpp
256+
│   ├── memory
257+
│   │   ├── page.asm
258+
│   │   ├── page.cpp
259+
│   │   └── pool.cpp
260+
│   ├── process
261+
│   │   ├── proc.cpp
262+
│   │   ├── tss.asm
263+
│   │   └── tss.cpp
264+
│   ├── stl
265+
│   │   ├── cstring.cpp
266+
│   │   ├── mutex.cpp
267+
│   │   └── semaphore.cpp
268+
│   ├── syscall
269+
│   │   ├── call.asm
270+
│   │   └── call.cpp
271+
│   ├── thread
272+
│   │   ├── sync.cpp
273+
│   │   ├── thd.asm
274+
│   │   └── thd.cpp
275+
│   └── util
276+
│   ├── bitmap.cpp
277+
│   ├── format.cpp
278+
│   └── tag_list.cpp
279+
└── user
280+
├── io
281+
│   ├── file
282+
│   │   ├── dir.cpp
283+
│   │   └── file.cpp
284+
│   └── video
285+
│   └── console.cpp
286+
├── memory
287+
│   └── pool.cpp
288+
└── process
289+
└── proc.cpp
290+
```
291+
69292
## License
70293

71294
Distributed under the *MIT License*. See `LICENSE` for more information.

Diff for: include/kernel/debug/assert.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
2-
* Diagnostics tools.
2+
* @file assert.h
3+
* @brief * Diagnostics tools.
4+
*
5+
* @par GitHub
6+
* https://github.com/Zhuagenborn
37
*/
48

59
#pragma once

Diff for: include/kernel/descriptor/desc.h

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
2-
* Descriptors.
2+
* @file desc.h
3+
* @brief Descriptors.
4+
*
5+
* @par GitHub
6+
* https://github.com/Zhuagenborn
37
*/
48

59
#pragma once
@@ -62,7 +66,9 @@ enum class NonSysType {
6266
};
6367

6468
/**
65-
* The descriptor attribute.
69+
* @brief The descriptor attribute.
70+
*
71+
* @details
6672
* It is located in the bits `40`-`47` of a descriptor.
6773
*/
6874
class Attribute {
@@ -240,7 +246,9 @@ class Descriptor {
240246
static_assert(sizeof(Descriptor) == sizeof(stl::uint64_t));
241247

242248
/**
243-
* The gate descriptor.
249+
* @brief The gate descriptor.
250+
*
251+
* @details
244252
* There are four types of gate descriptors:
245253
* - The task gate descriptor.
246254
* - The call gate descriptor.
@@ -309,13 +317,13 @@ class GateDesc : public Descriptor {
309317
static_assert(sizeof(GateDesc) == sizeof(stl::uint64_t));
310318

311319
/**
312-
* @brief
313-
* The segment descriptor.
320+
* @brief The segment descriptor.
321+
*
322+
* @details
314323
* It is a part of memory segmentation, used for translating a logical address into a linear address.
315324
* It describes the memory segment referred to in the logical address.
316325
*
317-
* @details
318-
* ```
326+
* @code
319327
* --------------------------------------------- High 32 bits ---------------------------------------------
320328
* 31-24 23 22 21 20 19-16 15 14-13 12 11-8 7-0
321329
* ┌────────────┬───┬─────┬───┬─────┬─────────────┬───┬─────┬───┬──────┬────────────┐
@@ -338,7 +346,7 @@ static_assert(sizeof(GateDesc) == sizeof(stl::uint64_t));
338346
* ┌───────────┬────────────┐
339347
* │ Base 15-0 │ Limit 15-0 │
340348
* └───────────┴────────────┘
341-
* ```
349+
* @endcode
342350
*/
343351
class SegDesc : public Descriptor {
344352
public:
@@ -435,7 +443,9 @@ static_assert(sizeof(SegDesc) == sizeof(stl::uint64_t));
435443
#pragma pack(push, 1)
436444

437445
/**
438-
* The descriptor table register.
446+
* @brief The descriptor table register.
447+
*
448+
* @details
439449
* They store the location of a descriptor table.
440450
*/
441451
class DescTabReg {
@@ -505,9 +515,7 @@ class DescTab {
505515
virtual const T& GetDesc(stl::size_t) const noexcept = 0;
506516
};
507517

508-
/**
509-
* The descriptor table that refers to a contiguous sequence of descriptors.
510-
*/
518+
//! The descriptor table that refers to a contiguous sequence of descriptors.
511519
template <typename T>
512520
class DescTabSpan : public DescTab<T> {
513521
public:
@@ -531,9 +539,7 @@ class DescTabSpan : public DescTab<T> {
531539
T* descs_;
532540
};
533541

534-
/**
535-
* The descriptor table that uses a built-in array to store descriptors.
536-
*/
542+
//! The descriptor table that uses a built-in array to store descriptors.
537543
template <typename T, stl::size_t count>
538544
class DescTabArray : public DescTab<T> {
539545
public:

Diff for: include/kernel/descriptor/gdt/idx.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
2-
* Global descriptor indexes.
2+
* @file idx.h
3+
* @brief Global descriptor indexes.
4+
*
5+
* @par GitHub
6+
* https://github.com/Zhuagenborn
37
*/
48

59
#pragma once

Diff for: include/kernel/descriptor/gdt/tab.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
2-
* The global descriptor table.
2+
* @file tab.h
3+
* @brief The global descriptor table.
4+
*
5+
* @par GitHub
6+
* https://github.com/Zhuagenborn
37
*/
48

59
#pragma once

0 commit comments

Comments
 (0)