Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 510a2c0e73 | |||
| 4f650b3704 | |||
| 679b943e0e | |||
| 2d5e3ad41f | |||
| 48ac939566 | |||
| 60873784d2 | |||
| f643e11212 | |||
| e654600c27 | |||
| d499a07b0f | |||
| 918b00e43d | |||
| 3d3c713828 | |||
| 55932ce89e | |||
| a572db52fd | |||
| 3f73b8d8a0 | |||
| 0965669f4b | |||
| 565df959b1 | |||
| 45376a2bb3 | |||
| de9daa4a85 | |||
| 8e1424fbec | |||
| 79f150a3d5 | |||
| b61655b9de | |||
| 3cf8ae04f1 | |||
| 25b4a34f1b | |||
| b1f3169310 | |||
| 26daf96b90 | |||
| 206d0ebf05 | |||
| a64ce2f81d | |||
| 5aaddd467c | |||
| 0fd6bec4a3 | |||
| c1cc7e366a |
+81
-43
@@ -1,52 +1,90 @@
|
||||
name: Main
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "releases/**"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".gitignore"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".gitignore"
|
||||
push:
|
||||
branches-ignore:
|
||||
- "releases/**"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".gitignore"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".gitignore"
|
||||
jobs:
|
||||
doxygen:
|
||||
name: Doxygen
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
doxygen:
|
||||
name: Doxygen
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Doxygen Ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y doxygen nasm
|
||||
- name: Install Doxygen Ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y doxygen nasm
|
||||
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
cmake -B build -D DOXYGEN_WARN_AS_ERROR=NO
|
||||
cmake --build build --target doxygen_doc
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
cmake -B build -D DOXYGEN_WARN_AS_ERROR=NO
|
||||
cmake --build build --target mentos_documentation
|
||||
|
||||
test:
|
||||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
test:
|
||||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: [
|
||||
# You can access the following values via ${{ matrix.??? }}
|
||||
#
|
||||
# pkgs : apt-get package names. It can include multiple package names which are delimited by space.
|
||||
# cc : C compiler executable.
|
||||
# cxx : C++ compiler executable for `make ctocpptest`.
|
||||
# x32 : Set 'true' if compiler supports x32. Otherwise, set 'false'.
|
||||
# Set 'fail' if it supports x32 but fails for now. 'fail' cases must be removed.
|
||||
# x86 : Set 'true' if compiler supports x86 (-m32). Otherwise, set 'false'.
|
||||
# Set 'fail' if it supports x86 but fails for now. 'fail' cases must be removed.
|
||||
# cxxtest : Set 'true' if it can be compiled as C++ code. Otherwise, set 'false'.
|
||||
# freestanding : Set 'true' if it can be compiled and execute freestanding code. Otherwise, set 'false'.
|
||||
# Usually, it requires Linux, x86_64 and gcc/g++.
|
||||
# os : GitHub Actions YAML workflow label. See https://github.com/actions/virtual-environments#available-environments
|
||||
# gcc
|
||||
{ pkgs: 'nasm', cc: gcc, cxx: g++, os: ubuntu-latest, },
|
||||
{ pkgs: 'gcc-12 g++-12 nasm', cc: gcc-12, cxx: g++-12, os: ubuntu-22.04, },
|
||||
{ pkgs: 'gcc-11 g++-11 nasm', cc: gcc-11, cxx: g++-11, os: ubuntu-22.04, },
|
||||
{ pkgs: 'gcc-10 g++-10 nasm', cc: gcc-10, cxx: g++-10, os: ubuntu-22.04, },
|
||||
{ pkgs: 'gcc-9 g++-9 nasm', cc: gcc-9, cxx: g++-9, os: ubuntu-22.04, },
|
||||
{ pkgs: 'gcc-8 g++-8 nasm', cc: gcc-8, cxx: g++-8, os: ubuntu-20.04, },
|
||||
{ pkgs: 'gcc-7 g++-7 nasm', cc: gcc-7, cxx: g++-7, os: ubuntu-20.04, },
|
||||
# clang
|
||||
{ pkgs: 'nasm', cc: clang, cxx: clang++, os: ubuntu-latest, },
|
||||
{ pkgs: 'clang-14 nasm', cc: clang-14, cxx: clang++-14, os: ubuntu-22.04, },
|
||||
{ pkgs: 'clang-13 nasm', cc: clang-13, cxx: clang++-13, os: ubuntu-22.04, },
|
||||
{ pkgs: 'clang-12 nasm', cc: clang-12, cxx: clang++-12, os: ubuntu-22.04, },
|
||||
{ pkgs: 'clang-11 nasm', cc: clang-11, cxx: clang++-11, os: ubuntu-22.04, },
|
||||
{ pkgs: 'clang-10 nasm', cc: clang-10, cxx: clang++-10, os: ubuntu-20.04, },
|
||||
{ pkgs: 'clang-9 nasm', cc: clang-9, cxx: clang++-9, os: ubuntu-20.04, },
|
||||
{ pkgs: 'clang-8 nasm', cc: clang-8, cxx: clang++-8, os: ubuntu-20.04, },
|
||||
{ pkgs: 'clang-7 nasm', cc: clang-7, cxx: clang++-7, os: ubuntu-20.04, },
|
||||
]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
- name: Install NASM Ubuntu
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y nasm
|
||||
# Set environment variables
|
||||
env:
|
||||
# We globally set CC and CXX to improve compatibility with .travis.yml
|
||||
CC: ${{ matrix.cc }}
|
||||
CXX: ${{ matrix.cxx }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build
|
||||
cmake --build build --parallel 2
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ${{ matrix.pkgs }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build
|
||||
cmake --build build --parallel 2 --verbose
|
||||
|
||||
+5
-3
@@ -17,7 +17,7 @@ endif()
|
||||
# =============================================================================
|
||||
# DOCUMENTATION
|
||||
# =============================================================================
|
||||
add_subdirectory(doc/doxygen)
|
||||
add_subdirectory(doc)
|
||||
|
||||
# =============================================================================
|
||||
# OS-SPECIFIC COMPILERS
|
||||
@@ -68,6 +68,8 @@ else()
|
||||
else()
|
||||
# set(EMULATOR_FLAGS ${EMULATOR_FLAGS} -sdl)
|
||||
endif()
|
||||
# Speicfy the linker.
|
||||
set(CMAKE_LINKER ld)
|
||||
endif()
|
||||
|
||||
# =============================================================================
|
||||
@@ -93,7 +95,7 @@ add_custom_target(filesystem
|
||||
COMMAND echo '============================================================================='
|
||||
COMMAND mkdir -p ${CMAKE_SOURCE_DIR}/files/proc
|
||||
COMMAND mkdir -p ${CMAKE_SOURCE_DIR}/files/dev
|
||||
COMMAND mke2fs -L 'rootfs' -N 0 -d ${CMAKE_SOURCE_DIR}/files -m 5 -r 1 -t ext2 -v -F ${CMAKE_BINARY_DIR}/rootfs.img 32M
|
||||
COMMAND mke2fs -L 'rootfs' -N 0 -d ${CMAKE_SOURCE_DIR}/files -b 4096 -m 5 -r 1 -t ext2 -v -F ${CMAKE_BINARY_DIR}/rootfs.img 32M
|
||||
COMMAND echo '============================================================================='
|
||||
COMMAND echo 'Done!'
|
||||
COMMAND echo '============================================================================='
|
||||
@@ -155,7 +157,7 @@ add_custom_target(
|
||||
# First, we need to generate a GDB file containing all the symbols of all our
|
||||
# executables.
|
||||
add_custom_target(
|
||||
.gdbinit
|
||||
gdbinit
|
||||
BYPRODUCTS ${CMAKE_BINARY_DIR}/.gdbinit
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/get_text_address.sh ${CMAKE_BINARY_DIR}/mentos/kernel.bin > ${CMAKE_BINARY_DIR}/.gdbinit
|
||||
COMMAND bash ${CMAKE_SOURCE_DIR}/scripts/get_text_address.sh ${CMAKE_BINARY_DIR}/mentos/kernel-bootloader.bin >> ${CMAKE_BINARY_DIR}/.gdbinit
|
||||
|
||||
@@ -202,29 +202,42 @@ This example sets the `__DEBUG_LEVEL__`, so that all the messages from `INFO` an
|
||||
|
||||
## 7. Change the scheduling algorithm
|
||||
|
||||
MentOS provides three different scheduling algorithms:
|
||||
MentOS supports scheduling algorithms for aperiodic:
|
||||
|
||||
- Round-Robin
|
||||
- Priority
|
||||
- Completely Fair Scheduling
|
||||
- Round-Robin (RR)
|
||||
- Highest Priority
|
||||
- Completely Fair Scheduling (CFS)
|
||||
- Aperiodic Earliest Deadline First (AEDF)
|
||||
|
||||
If you want to change the scheduling algorithm:
|
||||
It also supports periodic algorithms:
|
||||
|
||||
- Earliest Deadline First (EDF)
|
||||
- Rate Monotonic (RM)
|
||||
|
||||
If you want to change the scheduling algorithm, to Round-Robin (RR) for instance:
|
||||
|
||||
```bash
|
||||
|
||||
cd build
|
||||
|
||||
# Round Robin scheduling algorithm
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_RR ..
|
||||
# Priority scheduling algorithm
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_PRIORITY ..
|
||||
# Completely Fair Scheduling algorithm
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_CFS ..
|
||||
|
||||
make
|
||||
make qemu
|
||||
```
|
||||
|
||||
or you can activate one of the others:
|
||||
|
||||
```bash
|
||||
# Highest Priority
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_PRIORITY ..
|
||||
# Completely Fair Scheduling (CFS)
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_CFS ..
|
||||
# Earliest Deadline First (EDF)
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_EDF ..
|
||||
# Rate Monotonic (RM)
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_RM ..
|
||||
# Aperiodic Earliest Deadline First (AEDF)
|
||||
cmake -DSCHEDULER_TYPE=SCHEDULER_AEDF ..
|
||||
```
|
||||
|
||||
Otherwise you can use `ccmake`:
|
||||
|
||||
```bash
|
||||
@@ -244,8 +257,7 @@ ENABLE_BUDDY_SYSTEM OFF
|
||||
SCHEDULER_TYPE SCHEDULER_RR
|
||||
```
|
||||
|
||||
Select SCHEDULER_TYPE, and type Enter to scroll the three available algorithms
|
||||
(SCHEDULER_RR, SCHEDULER_PRIORITY, SCHEDULER_CFS). Afterwards,
|
||||
Select SCHEDULER_TYPE, and type Enter to scroll the three available algorithms (SCHEDULER_RR, SCHEDULER_PRIORITY, SCHEDULER_CFS, SCHEDULER_EDF, SCHEDULER_RM, SCHEDULER_AEDF). Afterwards, you need to
|
||||
|
||||
```bash
|
||||
<press c>
|
||||
@@ -264,33 +276,34 @@ cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
Then, you need to generate a file called `.gdbinit` placed inside the `build` directory, which will tell **gdb** which *object* file he needs to read in order to allow proper debugging.
|
||||
Then, you need to generate a file called `.gdbinit` placed inside the `build` directory, which will tell **gdb** which *object* file he needs to read in order to allow proper debugging. Basically, it provides for each binary file, the location of their `.text` section. To generate the file, just execute:
|
||||
```bash
|
||||
make gdb_file
|
||||
make gdbinit
|
||||
```
|
||||
|
||||
Finally, you run qemu in debugging mode with:
|
||||
```bash
|
||||
make qemu-gdb
|
||||
```
|
||||
|
||||
If you did everything correctly, you should see an empty QEMU window. Basically, QEMU is waiting for you to connect *remotely* with gdb. Anyway, running `make qemu-gdb` will make your current shell busy, you cannot call `gdb` in it. You need to open a new shell inside the `build` folder and do a:
|
||||
```bash
|
||||
cgdb -q -iex 'add-auto-load-safe-path .'
|
||||
```
|
||||
|
||||
Now you will have:
|
||||
1. the QEMU window waiting for you,
|
||||
2. the shell where you ran `make qemu-gdb` also waiting for you,
|
||||
3. the debugger that loaded a series of symbol files and the location of their `.text` section.
|
||||
Now you should have in front of you:
|
||||
1. the QEMU window waiting for you;
|
||||
2. the **first** shell where you ran `make qemu-gdb`, which is also waiting for you;
|
||||
3. the **second** shell where `gdb` is runnign and, you guessed it, is waiting for you.
|
||||
|
||||
By default I placed a breakpoint at the begginning of 1) the bootloader, 2) the `kmain` function of the kernel.
|
||||
By default I placed a breakpoint at the begginning of (1) the *bootloader* and (2) the *kernel* itself.
|
||||
|
||||
So, when gdb starts you need to first give a continue:
|
||||
```bash
|
||||
(gdb) continue
|
||||
```
|
||||
|
||||
This will make the kernel run, and stop at the first breakpoint which is inside the *bootloader*:
|
||||
This will make the kernel run, and stop at the **first** breakpoint which is inside the *bootloader*:
|
||||
```bash
|
||||
Breakpoint 1, boot_main (...) at .../mentos/src/boot.c:220
|
||||
220 {
|
||||
@@ -298,7 +311,7 @@ Breakpoint 1, boot_main (...) at .../mentos/src/boot.c:220
|
||||
|
||||
giving a second `continue` will get you to the start of the operating system:
|
||||
|
||||
This will make the kernel run, and stop at the first breakpoint which is inside the *bootloader*:
|
||||
This will make the kernel run, and stop at the **second** breakpoint which is inside the *kernel*:
|
||||
```bash
|
||||
Breakpoint 2, kmain (...) at .../mentos/src/kernel.c:95
|
||||
95 {
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
# Find Doxygen
|
||||
find_package(Doxygen)
|
||||
|
||||
if (DOXYGEN_FOUND)
|
||||
# Read the file with the version.
|
||||
file(READ ${PROJECT_SOURCE_DIR}/mentos/inc/version.h version_file)
|
||||
# Extract the OS version.
|
||||
string(REGEX MATCH "OS_MAJOR_VERSION ([0-9]*)" _ ${version_file})
|
||||
set(OS_MAJOR_VERSION ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "OS_MINOR_VERSION ([0-9]*)" _ ${version_file})
|
||||
set(OS_MINOR_VERSION ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "OS_MICRO_VERSION ([0-9]*)" _ ${version_file})
|
||||
set(OS_MICRO_VERSION ${CMAKE_MATCH_1})
|
||||
# Setup the Doxygen documentation.
|
||||
set(DOXYGEN_PROJECT_NAME "MentOS")
|
||||
set(DOXYGEN_PROJECT_NUMBER "${OS_MAJOR_VERSION}.${OS_MINOR_VERSION}.${OS_MICRO_VERSION}")
|
||||
set(DOXYGEN_PROJECT_BRIEF "The Mentoring Operating System")
|
||||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${PROJECT_SOURCE_DIR}/README.md)
|
||||
set(DOXYGEN_IMAGE_PATH ${PROJECT_SOURCE_DIR}/doc/resources)
|
||||
set(DOXYGEN_SHOW_INCLUDE_FILES NO)
|
||||
set(DOXYGEN_GENERATE_TREEVIEW NO)
|
||||
set(DOXYGEN_WARN_NO_PARAMDOC YES)
|
||||
set(DOXYGEN_HTML_STYLESHEET ${PROJECT_SOURCE_DIR}/doc/doxygen.css)
|
||||
doxygen_add_docs(
|
||||
${PROJECT_NAME}_documentation
|
||||
${PROJECT_SOURCE_DIR}/README.md
|
||||
${PROJECT_SOURCE_DIR}/CODING_STYLE.md
|
||||
${PROJECT_SOURCE_DIR}/LICENSE.md
|
||||
${PROJECT_SOURCE_DIR}/TODO.md
|
||||
${PROJECT_SOURCE_DIR}/doc/signal.md
|
||||
${PROJECT_SOURCE_DIR}/doc/syscall.md
|
||||
${PROJECT_SOURCE_DIR}/libc/src/crt0.S
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/array.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/assert.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/bits/ioctls.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/bits/stat.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/bits/termios-struct.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ctype.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/debug.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/fcntl.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/fcvt.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/grp.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/io/mm_io.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/io/port_io.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ipc/ipc.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ipc/msg.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ipc/sem.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ipc/shm.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/libgen.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/limits.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/math.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/pwd.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/ring_buffer.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sched.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/signal.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stdarg.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stdbool.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stddef.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stdint.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stdio.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/stdlib.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/strerror.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/string.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/bitops.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/dirent.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/errno.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/ioctl.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/reboot.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/stat.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/types.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/unistd.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/utsname.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/sys/wait.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/system/syscall_types.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/termios.h
|
||||
${PROJECT_SOURCE_DIR}/libc/inc/time.h
|
||||
${PROJECT_SOURCE_DIR}/libc/src/abort.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/assert.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/ctype.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/debug.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/fcvt.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/grp.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/io/mm_io.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/io/port_io.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/ipc/ipc.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/libc_start.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/libgen.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/math.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/pwd.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/sched.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/setenv.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/stdio.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/stdlib.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/strerror.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/string.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/sys/errno.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/sys/ioctl.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/sys/unistd.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/sys/utsname.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/termios.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/time.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/chdir.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/close.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/creat.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/exec.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/exit.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/fork.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getcwd.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getdents.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getgid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getpgid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getpid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getppid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getsid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/getuid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/interval.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/kill.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/lseek.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/mkdir.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/nice.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/open.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/read.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/reboot.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/rmdir.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/setgid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/setpgid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/setsid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/setuid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/signal.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/stat.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/unlink.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/waitpid.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/unistd/write.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/vscanf.c
|
||||
${PROJECT_SOURCE_DIR}/libc/src/vsprintf.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/boot.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/exception.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/gdt.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/idt.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/interrupt.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/tss.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/process/user.S
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/boot.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/descriptor_tables/gdt.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/descriptor_tables/idt.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/descriptor_tables/isr.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/descriptor_tables/tss.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/devices/fpu.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/devices/pci.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/ata.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/fdc.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/keyboard/keyboard.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/keyboard/keymap.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/mouse.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/ps2.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/drivers/rtc.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/elf/elf.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/fs/ext2.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/fs/ioctl.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/fs/procfs.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/fs/vfs.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/fs/vfs_types.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/hardware/cpuid.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/hardware/pic8259.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/hardware/timer.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/debug.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/mm_io.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/port_io.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/proc_modules.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/vga/vga.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/vga/vga_font.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/vga/vga_mode.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/vga/vga_palette.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/io/video.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/kernel.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/compiler.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/hashmap.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/irqflags.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/list.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/list_head.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/mutex.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/ndtree.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/rbtree.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/spinlock.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/stack_helper.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/klib/stdatomic.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/link_access.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/buddysystem.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/gfp.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/kheap.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/paging.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/slab.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/vmem_map.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/mem/zone_allocator.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/multiboot.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/process/prio.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/process/process.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/process/scheduler.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/process/wait.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/proc_access.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/errno.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/ipc.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/kernel_levels.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/module.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/reboot.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/types.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/sys/utsname.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/system/panic.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/system/printk.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/system/signal.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/system/syscall.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/inc/version.h
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/boot.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/exception.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/gdt.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/idt.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/interrupt.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/descriptor_tables/tss.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/devices/fpu.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/devices/pci.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/ata.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/fdc.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/keyboard/keyboard.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/keyboard/keymap.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/mouse.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/ps2.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/drivers/rtc.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/elf/elf.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/ext2.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/ioctl.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/namei.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/open.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/procfs.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/readdir.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/read_write.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/stat.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/fs/vfs.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/hardware/cpuid.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/hardware/pic8259.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/hardware/timer.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/debug.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/mm_io.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/port_io.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/proc_running.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/proc_system.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/proc_video.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/stdio.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/vga/vga.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/io/video.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/ipc/msg.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/ipc/sem.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/ipc/shm.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/kernel/sys.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/kernel.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/assert.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/ctype.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/fcvt.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/hashmap.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/libgen.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/list.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/math.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/mutex.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/ndtree.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/rbtree.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/spinlock.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/strerror.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/string.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/time.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/vscanf.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/klib/vsprintf.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/buddysystem.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/kheap.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/paging.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/slab.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/vmem_map.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/mem/zone_allocator.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/multiboot.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/process/process.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/process/scheduler.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/process/scheduler_algorithm.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/process/wait.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/sys/module.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/sys/utsname.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/system/errno.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/system/panic.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/system/printk.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/system/signal.c
|
||||
${PROJECT_SOURCE_DIR}/mentos/src/system/syscall.c
|
||||
)
|
||||
endif (DOXYGEN_FOUND)
|
||||
@@ -26,6 +26,31 @@
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.sm-dox a:hover {
|
||||
color: #4b5263;
|
||||
background-color: #A9B7C6;
|
||||
}
|
||||
|
||||
.sm-dox ul,
|
||||
.sm-dox ul a {
|
||||
color: #A9B7C6;
|
||||
background-color: #4b5263;
|
||||
}
|
||||
|
||||
.sm-dox ul a.highlighted {
|
||||
color: #4b5263;
|
||||
background-color: #A9B7C6;
|
||||
}
|
||||
|
||||
.sm-dox ul a:hover {
|
||||
color: #4b5263;
|
||||
background-color: #A9B7C6;
|
||||
background-image: none;
|
||||
background-repeat: no-repeat;
|
||||
text-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.memberdecls tr:not(:first-child) {
|
||||
background-color: #333842;
|
||||
}
|
||||
@@ -599,7 +624,8 @@ table.memberdecls {
|
||||
}
|
||||
|
||||
.memTemplParams {
|
||||
color: #4665A2;
|
||||
color: #728dc2;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
font-size: 80%;
|
||||
}
|
||||
@@ -633,9 +659,10 @@ table.memberdecls {
|
||||
|
||||
.memtemplate {
|
||||
font-size: 80%;
|
||||
color: #4665A2;
|
||||
font-weight: normal;
|
||||
color: #728dc2;
|
||||
font-weight: bold;
|
||||
margin-left: 9px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.memnav {
|
||||
@@ -686,6 +713,12 @@ dl.reflist dd {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.memdoc p {
|
||||
padding: 0.25em;
|
||||
border-radius: 4px;
|
||||
background-color: #3A3F49;
|
||||
}
|
||||
|
||||
dl.reflist dt {
|
||||
padding: 5px;
|
||||
}
|
||||
@@ -857,6 +890,7 @@ div.directory {
|
||||
font-family: Arial, Helvetica;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
display: inline-block;
|
||||
@@ -879,7 +913,7 @@ div.directory {
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image: url("folderopen.png");
|
||||
background-position: 0px -4px;
|
||||
/* background-position: 0px -4px; */
|
||||
background-repeat: repeat-y;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
@@ -890,7 +924,7 @@ div.directory {
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image: url("folderclosed.png");
|
||||
background-position: 0px -4px;
|
||||
/* background-position: 0px -4px; */
|
||||
background-repeat: repeat-y;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
@@ -901,7 +935,7 @@ div.directory {
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image: url("doc.png");
|
||||
background-position: 0px -4px;
|
||||
/* background-position: 0px -4px; */
|
||||
background-repeat: repeat-y;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
@@ -950,7 +984,7 @@ table.doxtable th {
|
||||
}
|
||||
|
||||
table.fieldtable {
|
||||
/*width: 100%;*/
|
||||
width: fit-content;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #A8B8D9;
|
||||
border-spacing: 0px;
|
||||
@@ -960,7 +994,6 @@ table.fieldtable {
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
|
||||
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
|
||||
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.fieldtable td,
|
||||
@@ -998,11 +1031,9 @@ table.fieldtable {
|
||||
}
|
||||
|
||||
.fieldtable th {
|
||||
background-image: url("nav_f.png");
|
||||
background-repeat: repeat-x;
|
||||
background-color: #E2E8F2;
|
||||
font-size: 90%;
|
||||
color: #253555;
|
||||
font-size: 100%;
|
||||
color: #d7dee4;
|
||||
background-color: #49515f;
|
||||
padding-bottom: 4px;
|
||||
padding-top: 5px;
|
||||
text-align: left;
|
||||
@@ -1,37 +0,0 @@
|
||||
# Find Doxygen
|
||||
find_package(Doxygen)
|
||||
|
||||
if (DOXYGEN_FOUND)
|
||||
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/html/index.html)
|
||||
|
||||
# Replace variables inside @@ with the current values.
|
||||
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
|
||||
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
|
||||
|
||||
# Copy the files needd by the documentation.
|
||||
set(DOXYFILE_CSS ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.css)
|
||||
set(DOXYFILE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/header.html)
|
||||
set(DOXYFILE_FOOTER ${CMAKE_CURRENT_SOURCE_DIR}/footer.html)
|
||||
|
||||
# Doxygen won't create this for us.
|
||||
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${DOXYGEN_INDEX_FILE}
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
|
||||
|
||||
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
|
||||
COMMENT "Generating docs"
|
||||
)
|
||||
add_custom_target(
|
||||
doxygen_doc
|
||||
DEPENDS
|
||||
${DOXYGEN_INDEX_FILE}
|
||||
${DOXYFILE_IN}
|
||||
${DOXYFILE_CSS}
|
||||
${DOXYFILE_HEADER}
|
||||
${DOXYFILE_FOOTER}
|
||||
)
|
||||
endif (DOXYGEN_FOUND)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
||||
<!-- HTML footer for doxygen 1.8.16-->
|
||||
<!-- start footer part -->
|
||||
<!--BEGIN GENERATE_TREEVIEW-->
|
||||
<div id="nav-path" class="navpath">
|
||||
<!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
$navpath
|
||||
<li class="footer">$generatedby
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="$relpath^doxygen.png" alt="doxygen" />
|
||||
</a> $doxygenversion
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--END GENERATE_TREEVIEW-->
|
||||
<!--BEGIN !GENERATE_TREEVIEW-->
|
||||
<div class="footer">
|
||||
<hr class="footer" />
|
||||
<ul class="footer-info">
|
||||
<li class="footer-info-lastmode">
|
||||
This page was last modified on $datetime.
|
||||
</li>
|
||||
<li class="footer-info-copyright">
|
||||
MentOs © 2014–2022 the MentOs-Team, and numerous contributors.<br>
|
||||
It is available for use and modification under the 
|
||||
<a href="$relpath^md_LICENSE.html">MIT License</a>.<br>
|
||||
</li>
|
||||
</ul>
|
||||
<hr class="footer" />
|
||||
<address class="footer">
|
||||
$generatedby 
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="$relpath^doxygen.png" alt="doxygen" />
|
||||
</a> $doxygenversion
|
||||
</address>
|
||||
</div>
|
||||
<!--END !GENERATE_TREEVIEW-->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,66 +0,0 @@
|
||||
<!-- HTML header for doxygen 1.8.17-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9" />
|
||||
<meta name="generator" content="Doxygen $doxygenversion" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!--BEGIN PROJECT_NAME-->
|
||||
<title>$projectname: $title</title>
|
||||
<!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME-->
|
||||
<title>$title</title>
|
||||
<!--END !PROJECT_NAME-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="top">
|
||||
<!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<!--BEGIN PROJECT_LOGO-->
|
||||
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo" /></td>
|
||||
<!--END PROJECT_LOGO-->
|
||||
<!--BEGIN PROJECT_NAME-->
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">$projectname
|
||||
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">$projectnumber</span>
|
||||
<!--END PROJECT_NUMBER-->
|
||||
</div>
|
||||
<!--BEGIN PROJECT_BRIEF-->
|
||||
<div id="projectbrief">$projectbrief</div>
|
||||
<!--END PROJECT_BRIEF-->
|
||||
</td>
|
||||
<!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME-->
|
||||
<!--BEGIN PROJECT_BRIEF-->
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectbrief">$projectbrief</div>
|
||||
</td>
|
||||
<!--END PROJECT_BRIEF-->
|
||||
<!--END !PROJECT_NAME-->
|
||||
<!--BEGIN DISABLE_INDEX-->
|
||||
<!--BEGIN SEARCHENGINE-->
|
||||
<td>$searchbox</td>
|
||||
<!--END SEARCHENGINE-->
|
||||
<!--END DISABLE_INDEX-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1 @@
|
||||
Call `man` to have a list of all the commands.
|
||||
@@ -0,0 +1,8 @@
|
||||
SYNOPSIS
|
||||
cat [FILE]
|
||||
|
||||
DESCRIPTION
|
||||
Prints the content of the given file.
|
||||
|
||||
OPTIONS
|
||||
-h --help : shows command help.
|
||||
@@ -0,0 +1,5 @@
|
||||
SYNOPSIS
|
||||
clear
|
||||
|
||||
DESCRIPTION
|
||||
Clears the screen.
|
||||
@@ -0,0 +1,5 @@
|
||||
SYNOPSIS
|
||||
cpuid
|
||||
|
||||
DESCRIPTION
|
||||
Not currently implemented.
|
||||
@@ -0,0 +1,5 @@
|
||||
SYNOPSIS
|
||||
date
|
||||
|
||||
DESCRIPTION
|
||||
Shows the current date.
|
||||
@@ -0,0 +1,6 @@
|
||||
SYNOPSIS
|
||||
echo [STRING]
|
||||
|
||||
DESCRIPTION
|
||||
Displays a line of text.
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
NAME
|
||||
ls - list directory contents
|
||||
|
||||
SYNOPSIS
|
||||
ls [OPTIONS] [FILE/FOLDER]
|
||||
|
||||
@@ -10,5 +7,6 @@ DESCRIPTION
|
||||
inside the current folder.
|
||||
|
||||
OPTIONS
|
||||
-a : list all entries.
|
||||
-l : show the entries as a detailed list.
|
||||
-h --help : shows command help.
|
||||
-a --all : list all entries.
|
||||
-l --long : show the entries as a detailed long list.
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces")
|
||||
|
||||
# Set the compiler options.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
|
||||
|
||||
@@ -43,4 +43,4 @@ typedef struct termios {
|
||||
#define IEXTEN 0x00000400 ///< Enables implementation-defined input processing.
|
||||
|
||||
/// @brief Mask for extracting control values.
|
||||
#define CTRL(x) (x & 037)
|
||||
#define CTRL(x) (x & 037)
|
||||
|
||||
+1
-1
@@ -69,4 +69,4 @@ group_t *getgrent(void);
|
||||
void endgrent(void);
|
||||
|
||||
/// @brief May be called to close the group database when processing is complete.
|
||||
void setgrent(void);
|
||||
void setgrent(void);
|
||||
|
||||
+1
-1
@@ -21,4 +21,4 @@ struct ipc_perm {
|
||||
unsigned short mode;
|
||||
/// Sequence number.
|
||||
unsigned short __seq;
|
||||
};
|
||||
};
|
||||
|
||||
+1
-1
@@ -122,4 +122,4 @@ long msgrcv(int msqid, msgbuf_t *msgp, size_t msgsz, long msgtyp, int msgflg);
|
||||
/// @return 0 on success, -1 on failure and errno is set to indicate the error.
|
||||
long msgctl(int msqid, int cmd, msqid_ds_t *buf);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -72,4 +72,4 @@ long semop(int semid, struct sembuf *sops, unsigned nsops);
|
||||
/// @return 0 on success, -1 on failure and errno is set to indicate the error.
|
||||
long semctl(int semid, int semnum, int cmd, unsigned long arg);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -203,4 +203,4 @@ long shmdt(const void *shmaddr);
|
||||
/// failure and errno is set to indicate the error.
|
||||
long shmctl(int shmid, int cmd, struct shmid_ds *buf);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -37,4 +37,4 @@ char *basename(const char *path);
|
||||
/// If resolved is NULL, then realpath() uses malloc
|
||||
/// to allocate a buffer of up to PATH_MAX bytes to hold the
|
||||
/// resolved pathname, and returns a pointer to this buffer.
|
||||
char *realpath(const char *path, char *resolved);
|
||||
char *realpath(const char *path, char *resolved);
|
||||
|
||||
@@ -124,4 +124,4 @@
|
||||
}
|
||||
|
||||
#undef RING_BUFFER_ALLOC
|
||||
#undef RING_BUFFER_FREE
|
||||
#undef RING_BUFFER_FREE
|
||||
|
||||
+1
-1
@@ -123,4 +123,4 @@ int sscanf(const char *str, const char *fmt, ...);
|
||||
/// @return On success, the function returns the number of items of the
|
||||
/// argument list successfully filled. EOF otherwise.
|
||||
int fscanf(int fd, const char *fmt, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -307,4 +307,4 @@ char *replace_char(char *str, char find, char replace);
|
||||
/// referenced by p.
|
||||
/// @param mode File mode that encodes access permissions and file type.
|
||||
/// @param p Buffer used to hold the string representation of file mode m.
|
||||
void strmode(mode_t mode, char *p);
|
||||
void strmode(mode_t mode, char *p);
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define bitmask_check(V, M) ((V) & (M)) ///< Checks if the bits identified by the mask are all 1.
|
||||
|
||||
/// @brief Finds the first bit at zero, starting from the less significative bit.
|
||||
/// @param value the value we need to analyze.
|
||||
/// @return the position of the first zero bit.
|
||||
static inline int find_first_zero(unsigned long value)
|
||||
{
|
||||
for (int i = 0; i < 32; ++i)
|
||||
@@ -31,10 +33,12 @@ static inline int find_first_zero(unsigned long value)
|
||||
}
|
||||
|
||||
/// @brief Finds the first bit not zero, starting from the less significative bit.
|
||||
/// @param value the value we need to analyze.
|
||||
/// @return the position of the first non-zero bit.
|
||||
static inline int find_first_non_zero(unsigned long value)
|
||||
{
|
||||
for (int i = 0; i < 32; ++i)
|
||||
if (bit_check(value, i))
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -21,22 +21,23 @@ enum {
|
||||
DT_WHT = 14
|
||||
};
|
||||
|
||||
/// @brief Characters describing the direactory entry.
|
||||
static const char dt_char_array[] = {
|
||||
'?', // DT_UNKNOWN = 0,
|
||||
'p', //DT_FIFO = 1,
|
||||
'c', //DT_CHR = 2,
|
||||
'p', // DT_FIFO = 1,
|
||||
'c', // DT_CHR = 2,
|
||||
'*',
|
||||
'd', //DT_DIR = 4,
|
||||
'd', // DT_DIR = 4,
|
||||
'*',
|
||||
'b', //DT_BLK = 6,
|
||||
'b', // DT_BLK = 6,
|
||||
'*',
|
||||
'-', //DT_REG = 8,
|
||||
'-', // DT_REG = 8,
|
||||
'*',
|
||||
'l', //DT_LNK = 10,
|
||||
'l', // DT_LNK = 10,
|
||||
'*',
|
||||
's', //DT_SOCK = 12,
|
||||
's', // DT_SOCK = 12,
|
||||
'*',
|
||||
'?', //DT_WHT = 14
|
||||
'?', // DT_WHT = 14
|
||||
};
|
||||
|
||||
/// Directory entry.
|
||||
@@ -46,4 +47,4 @@ typedef struct dirent_t {
|
||||
unsigned short d_reclen; ///< Length of this linux_dirent.
|
||||
unsigned short d_type; ///< type of the directory entry.
|
||||
char d_name[NAME_MAX]; ///< Filename (null-terminated)
|
||||
} dirent_t;
|
||||
} dirent_t;
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
/// @param request The device-dependent request code
|
||||
/// @param data An untyped pointer to memory.
|
||||
/// @return Return value depends on REQUEST. Usually -1 indicates error.
|
||||
int ioctl(int fd, unsigned long int request, void *data);
|
||||
int ioctl(int fd, unsigned long int request, void *data);
|
||||
|
||||
+1
-1
@@ -39,4 +39,4 @@ int rmdir(const char *path);
|
||||
/// @return file descriptor number, -1 otherwise and errno is set to indicate the error.
|
||||
/// @details
|
||||
/// It is equivalent to: open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)
|
||||
int creat(const char *path, mode_t mode);
|
||||
int creat(const char *path, mode_t mode);
|
||||
|
||||
@@ -246,4 +246,4 @@ int getdents(int fd, dirent_t *dirp, unsigned int count);
|
||||
/// shall return a non-zero value that is the number of seconds until the
|
||||
/// previous request would have generated a SIGALRM signal. Otherwise, alarm()
|
||||
/// shall return 0.
|
||||
int alarm(int seconds);
|
||||
int alarm(int seconds);
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
#include "signal.h"
|
||||
#include "stdio.h"
|
||||
|
||||
// Since there could be signal handlers listening for the abort, we
|
||||
// need to keep track at which stage of the abort we are.
|
||||
/// @brief Since there could be signal handlers listening for the abort, we need
|
||||
/// to keep track at which stage of the abort we are.
|
||||
static int stage = 0;
|
||||
|
||||
void abort(void)
|
||||
|
||||
+1
-1
@@ -105,4 +105,4 @@ const char *dec_to_binary(unsigned long value, unsigned length)
|
||||
for (int i = 0, j = 32 - min(max(0, length), 32); j < 32; ++i, ++j)
|
||||
buffer[i] = bit_check(value, 31 - j) ? '1' : '0';
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -14,6 +14,10 @@
|
||||
|
||||
static int __fd = -1;
|
||||
|
||||
/// @brief It parses the line (as string) and saves its content inside the
|
||||
/// group_t structure.
|
||||
/// @param grp the struct where we store the information.
|
||||
/// @param buf the buffer from which we extract the information.
|
||||
static inline void __parse_line(group_t *grp, char *buf)
|
||||
{
|
||||
assert(grp && "Received null grp!");
|
||||
@@ -231,4 +235,4 @@ void setgrent(void)
|
||||
{
|
||||
//pr_debug("Resetting pointer to beginning of group file\n");
|
||||
lseek(__fd, 0, SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ inline uint32_t inportl(uint16_t port)
|
||||
{
|
||||
uint32_t rv;
|
||||
__asm__ __volatile__("inl %%dx, %%eax" : "=a"(rv) : "dN"(port));
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -49,7 +48,7 @@ inline void outports(uint16_t port, uint16_t data)
|
||||
|
||||
void outportsm(uint16_t port, uint8_t *data, uint16_t size)
|
||||
{
|
||||
asm volatile("rep outsw" : "+S"(data), "+c"(size) : "d"(port));
|
||||
__asm__ __volatile__("rep outsw" : "+S"(data), "+c"(size) : "d"(port));
|
||||
}
|
||||
|
||||
inline void outportl(uint16_t port, uint32_t data)
|
||||
|
||||
+1
-1
@@ -137,4 +137,4 @@ char *realpath(const char *path, char *resolved)
|
||||
else
|
||||
resolved[1] = '\0';
|
||||
return resolved;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,13 @@ ssize_t __readline(int fd, char *buffer, size_t buflen)
|
||||
return newline_len;
|
||||
}
|
||||
|
||||
/// @brief Searches for the given entry inside the buffer.
|
||||
/// @param fd the file descriptor of the file.
|
||||
/// @param buffer the support buffer we use to read the file.
|
||||
/// @param buflen the length of the support buffer.
|
||||
/// @param name the username we are looking for.
|
||||
/// @param uid the user-id of the user we are looking for.
|
||||
/// @return the buffer itself if we have found the entry, NULL otherwise.
|
||||
static inline char *__search_entry(int fd, char *buffer, int buflen, const char *name, uid_t uid)
|
||||
{
|
||||
while (__readline(fd, buffer, buflen)) {
|
||||
|
||||
@@ -13,6 +13,10 @@ char **environ;
|
||||
static char **__environ = NULL;
|
||||
static size_t __environ_size = 0;
|
||||
|
||||
/// @brief Finds the entry in the environ.
|
||||
/// @param name the name of the entry we are looking for.
|
||||
/// @param name_len the length of the name we received.
|
||||
/// @return the index of the entry, or -1 if we did not find it.
|
||||
static inline int __find_entry(const char *name, const size_t name_len)
|
||||
{
|
||||
if (environ) {
|
||||
@@ -24,6 +28,7 @@ static inline int __find_entry(const char *name, const size_t name_len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// @brief Makes a clone of the current environ.
|
||||
static void __clone_environ()
|
||||
{
|
||||
if (environ) {
|
||||
|
||||
+1
-1
@@ -205,4 +205,4 @@ char *fgets(char *buf, int n, int fd)
|
||||
if (p == buf || c == EOF)
|
||||
return NULL;
|
||||
return (p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
/// malloc(), calloc() or realloc().
|
||||
#define MALLOC_MAGIC_NUMBER 0x600DC0DE
|
||||
|
||||
/// @brief Checks if the pointer is a valid malloc entry.
|
||||
/// @param ptr the pointer we are checking.
|
||||
/// @return 1 of success, 0 on failure.
|
||||
static inline int __malloc_is_valid_ptr(void *ptr)
|
||||
{
|
||||
return (ptr && (((size_t *)ptr)[-1] == MALLOC_MAGIC_NUMBER));
|
||||
|
||||
@@ -33,4 +33,4 @@ int rmdir(const char *path)
|
||||
return mountpoint_list[mp_id].dir_op.rmdir_f(absolute_path);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -34,4 +34,4 @@ int tcsetattr(int fd, int optional_actions, const termios_t *termios_p)
|
||||
retval = -1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -397,4 +397,4 @@ unsigned int sleep(unsigned int seconds)
|
||||
|
||||
_syscall2(int, getitimer, int, which, itimerval *, curr_value)
|
||||
|
||||
_syscall3(int, setitimer, int, which, const itimerval *, new_value, itimerval *, old_value)
|
||||
_syscall3(int, setitimer, int, which, const itimerval *, new_value, itimerval *, old_value)
|
||||
|
||||
@@ -111,4 +111,4 @@ int sigismember(sigset_t *set, int signum)
|
||||
if (set)
|
||||
return bit_check(set->sig[(signum - 1) / 32], (signum - 1) % 32);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -689,4 +689,4 @@ int fprintf(int fd, const char *fmt, ...)
|
||||
return len;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces")
|
||||
|
||||
# Set the compiler options.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
|
||||
@@ -216,7 +216,7 @@ endif(ENABLE_ALLOC_TRACE)
|
||||
|
||||
# =============================================================================
|
||||
# Set the list of valid scheduling options.
|
||||
set(SCHEDULER_TYPES SCHEDULER_RR SCHEDULER_PRIORITY SCHEDULER_CFS SCHEDULER_EDF SCHEDULER_RM)
|
||||
set(SCHEDULER_TYPES SCHEDULER_RR SCHEDULER_PRIORITY SCHEDULER_CFS SCHEDULER_EDF SCHEDULER_RM SCHEDULER_AEDF)
|
||||
# Add the scheduling option.
|
||||
set(SCHEDULER_TYPE "SCHEDULER_RR" CACHE STRING "Chose the type of scheduler: ${SCHEDULER_TYPES}")
|
||||
# List of schedulers.
|
||||
|
||||
+2
-5
@@ -1,17 +1,14 @@
|
||||
OUTPUT_FORMAT("elf")
|
||||
OUTPUT_ARCH(i386)
|
||||
OUTPUT_FORMAT("elf32-i386")
|
||||
|
||||
ENTRY(boot_entry)
|
||||
|
||||
BOOTLOADER_PHYSICAL_ADDRESS = 0x00100000;
|
||||
|
||||
MEMORY {
|
||||
BOOTLOADER_MEM : ORIGIN = 0x00000000, LENGTH = 128M
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = BOOTLOADER_PHYSICAL_ADDRESS;
|
||||
. = 0x00100000;
|
||||
_bootloader_start = .;
|
||||
.multiboot . : AT(ADDR(.multiboot))
|
||||
{
|
||||
|
||||
@@ -138,4 +138,4 @@ void init_gdt();
|
||||
void gdt_set_gate(uint8_t index, uint32_t base, uint32_t limit, uint8_t access, uint8_t granul);
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -60,4 +60,4 @@ typedef struct idt_pointer_t {
|
||||
void init_idt();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -97,4 +97,4 @@ extern void isq_handler(pt_regs *f);
|
||||
//==============================================================================
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -60,4 +60,4 @@ void tss_init(uint8_t idx, uint32_t ss0);
|
||||
void tss_set_stack(uint32_t kss, uint32_t kesp);
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -130,4 +130,4 @@ void unswitch_fpu();
|
||||
int fpu_install();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -346,4 +346,4 @@ int pci_get_interrupt(uint32_t device);
|
||||
void pci_debug_scan();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -26,4 +26,4 @@ int ata_initialize();
|
||||
int ata_finalize();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -19,4 +19,4 @@ int fdc_initialize();
|
||||
int fdc_finalize();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -49,4 +49,4 @@ int keyboard_initialize();
|
||||
int keyboard_finalize();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -161,4 +161,4 @@ void init_keymaps();
|
||||
/// @}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -24,4 +24,4 @@ int mouse_initialize();
|
||||
int mouse_finalize();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -15,4 +15,4 @@ void ps2_write(unsigned char data);
|
||||
|
||||
/// @brief Reads data from the PS/2 port.
|
||||
/// @return the data coming from the PS/2 port.
|
||||
unsigned char ps2_read();
|
||||
unsigned char ps2_read();
|
||||
|
||||
@@ -26,4 +26,4 @@ int rtc_initialize();
|
||||
int rtc_finalize();
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -288,4 +288,4 @@ const char *elf_symbol_type_to_string(int type);
|
||||
/// @brief Transforms the passed ELF symbol bind to string.
|
||||
/// @param bind The integer representing the ELF symbol bind.
|
||||
/// @return The string representing the ELF symbol bind.
|
||||
const char *elf_symbol_bind_to_string(int bind);
|
||||
const char *elf_symbol_bind_to_string(int bind);
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
/// @param request The device-dependent request code
|
||||
/// @param data An untyped pointer to memory.
|
||||
/// @return On success zero is returned.
|
||||
int sys_ioctl(int fd, int request, void *data);
|
||||
int sys_ioctl(int fd, int request, void *data);
|
||||
|
||||
@@ -65,4 +65,4 @@ int procr_create_entry_pid(task_struct *entry);
|
||||
/// @brief Destroy the entire procfs entry tree for the give process.
|
||||
/// @param entry Pointer to the task_struct of the process.
|
||||
/// @return 0 if succeed, or -errno in case of error.
|
||||
int procr_destroy_entry_pid(task_struct *entry);
|
||||
int procr_destroy_entry_pid(task_struct *entry);
|
||||
|
||||
@@ -210,4 +210,4 @@ int sys_setitimer(int which, const struct itimerval *new_value, struct itimerval
|
||||
|
||||
/// @brief Update the profiling timer and generate SIGPROF if it has expired.
|
||||
/// @param proc The process for which we must update the profiling.
|
||||
void update_process_profiling_timer(task_struct *proc);
|
||||
void update_process_profiling_timer(task_struct *proc);
|
||||
|
||||
@@ -116,4 +116,4 @@ void vga_new_line();
|
||||
/// @brief Change the color.
|
||||
void vga_set_color(unsigned int color);
|
||||
|
||||
void vga_run_test();
|
||||
void vga_run_test();
|
||||
|
||||
@@ -290,4 +290,4 @@ palette_entry_t ansi_256_palette[256] = {
|
||||
{ 218, 218, 218 }, // Grey85
|
||||
{ 228, 228, 228 }, // Grey89
|
||||
{ 238, 238, 238 }, // Grey93
|
||||
};
|
||||
};
|
||||
|
||||
@@ -41,9 +41,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
/// @brief Assign the value to the given variable.
|
||||
#define WRITE_ONCE(var, val) (*((volatile typeof(val) *)(&(var))) = (val))
|
||||
#define WRITE_ONCE(var, val) (*((__volatile__ __typeof__(val) *)(&(var))) = (val))
|
||||
|
||||
/// @brief Read the value from the given variable.
|
||||
#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))
|
||||
#define READ_ONCE(var) (*((__volatile__ __typeof__(var) *)(&(var))))
|
||||
|
||||
+87
-97
@@ -19,8 +19,7 @@ typedef struct list_head {
|
||||
/// @param ptr The &list_head pointer.
|
||||
/// @param type The type of the struct this is embedded in.
|
||||
/// @param member The name of the list_head within the struct.
|
||||
#define list_entry(ptr, type, member) \
|
||||
container_of(ptr, type, member)
|
||||
#define list_entry(ptr, type, member) container_of(ptr, type, member)
|
||||
|
||||
/// @brief Iterates over a list.
|
||||
/// @param pos The &list_head to use as a loop cursor.
|
||||
@@ -49,124 +48,115 @@ typedef struct list_head {
|
||||
for (list_head * (pos) = (head)->next; (pos) != (head); (pos) = (pos)->next)
|
||||
|
||||
/// @brief Initializes the list_head.
|
||||
/// @param head The head for your list.
|
||||
#define list_head_init(head) (head)->next = (head)->prev = (head)
|
||||
|
||||
/// @brief Initializes the list_head.
|
||||
/// @param head The head for your list.
|
||||
#define list_head_size(head) \
|
||||
({ \
|
||||
unsigned __list_head_size = 0; \
|
||||
list_for_each_decl(it, head) __list_head_size += 1; \
|
||||
__list_head_size; \
|
||||
})
|
||||
|
||||
/// @brief Insert element l2 after l1.
|
||||
static inline void list_head_insert_after(list_head *l1, list_head *l2)
|
||||
/// @param head The head of your list.
|
||||
static inline void list_head_init(list_head *head)
|
||||
{
|
||||
// [La]->l1 La<-[l1]->Lb <-[l2]-> l1<-[Lb]
|
||||
|
||||
list_head *l1_next = l1->next;
|
||||
// [La]->l1 La<-[l1]->l2 <-[l2]-> l1<-[Lb]
|
||||
l1->next = l2;
|
||||
// [La]->l1 La<-[l1]->l2 l1<-[l2]-> l1<-[Lb]
|
||||
l2->prev = l1;
|
||||
// [La]->l1 La<-[l1]->l2 l1<-[l2]->Lb l1<-[Lb]
|
||||
l2->next = l1_next;
|
||||
// [La]->l1 La<-[l1]->l2 l1<-[l2]->Lb l2<-[Lb]
|
||||
l1_next->prev = l2;
|
||||
}
|
||||
|
||||
/// @brief Insert element l2 before l1.
|
||||
static inline void list_head_insert_before(list_head *l1, list_head *l2)
|
||||
{
|
||||
// [La]->l1 [l2] La<-[l1]->Lb l1<-[Lb]
|
||||
|
||||
list_head *l1_prev = l1->prev;
|
||||
// [La]->l2 [l2] La<-[l1]->Lb l1<-[Lb]
|
||||
l1_prev->next = l2;
|
||||
// [La]->l2 La<-[l2] La<-[l1]->Lb l1<-[Lb]
|
||||
l2->prev = l1_prev;
|
||||
// [La]->l2 La<-[l2]->l1 La<-[l1]->Lb l1<-[Lb]
|
||||
l2->next = l1;
|
||||
// [La]->l2 La<-[l2]->l1 l2<-[l1]->Lb l1<-[Lb]
|
||||
l1->prev = l2;
|
||||
}
|
||||
|
||||
/// @brief Remove l from the list.
|
||||
/// @param l The element to remove.
|
||||
static inline void list_head_del(list_head *l)
|
||||
{
|
||||
// [La]->l La<-[l]->Lb l<-[Lb]
|
||||
|
||||
// [La]->Lb La<-[l]->Lb l<-[Lb]
|
||||
l->prev->next = l->next;
|
||||
// [La]->Lb La<-[l]->Lb La<-[Lb]
|
||||
l->next->prev = l->prev;
|
||||
// [La]->Lb l<-[l]->l La<-[Lb]
|
||||
l->next = l->prev = l;
|
||||
head->next = head->prev = head;
|
||||
}
|
||||
|
||||
/// @brief Tests whether the given list is empty.
|
||||
/// @param head The list to check.
|
||||
/// @return 1 if empty, 0 otherwise.
|
||||
static inline int list_head_empty(list_head const *head)
|
||||
static inline int list_head_empty(const list_head *head)
|
||||
{
|
||||
return head->next == head;
|
||||
}
|
||||
|
||||
/// Insert a new entry between two known consecutive entries.
|
||||
static inline void __list_add(list_head *new, list_head *prev, list_head *next)
|
||||
/// @brief Initializes the list_head.
|
||||
/// @param head The head for your list.
|
||||
static inline unsigned list_head_size(const list_head *head)
|
||||
{
|
||||
// [prev]-> <-[new]-> <-[next]
|
||||
|
||||
// [prev]-> <-[new]-> new<-[next]
|
||||
next->prev = new;
|
||||
// [prev]-> <-[new]->next new<-[next]
|
||||
new->next = next;
|
||||
// [prev]-> prev<-[new]->next new<-[next]
|
||||
new->prev = prev;
|
||||
// [prev]->new prev<-[new]->next new<-[next]
|
||||
prev->next = new;
|
||||
unsigned size = 0;
|
||||
if (!list_head_empty(head))
|
||||
list_for_each_decl(it, head) size += 1;
|
||||
return size;
|
||||
}
|
||||
|
||||
/// @brief Insert element l2 before l1.
|
||||
static inline void list_head_add(list_head *new, list_head *head)
|
||||
/// @brief Insert the new entry after the given location.
|
||||
/// @param new_entry the new element we want to insert.
|
||||
/// @param location the element after which we insert.
|
||||
static inline void list_head_insert_after(list_head *new_entry, list_head *location)
|
||||
{
|
||||
__list_add(new, head, head->next);
|
||||
// We store the old `next` element.
|
||||
list_head *old_next = location->next;
|
||||
// We insert our element.
|
||||
location->next = new_entry;
|
||||
// We update the `previous` link of our new entry.
|
||||
new_entry->prev = location;
|
||||
// We update the `next` link of our new entry.
|
||||
new_entry->next = old_next;
|
||||
// We link the previously `next` element to our new entry.
|
||||
old_next->prev = new_entry;
|
||||
}
|
||||
|
||||
/// @brief Insert element l2 before l1.
|
||||
static inline void list_head_add_tail(list_head *new, list_head *head)
|
||||
/// @brief Insert the new entry before the given location.
|
||||
/// @param new_entry the new element we want to insert.
|
||||
/// @param location the element after which we insert.
|
||||
static inline void list_head_insert_before(list_head *new_entry, list_head *location)
|
||||
{
|
||||
__list_add(new, head->prev, head);
|
||||
// We store the old `previous` element.
|
||||
list_head *old_prev = location->prev;
|
||||
// We link the old `previous` element to our new entry.
|
||||
old_prev->next = new_entry;
|
||||
// We update the `previous` link of our new entry.
|
||||
new_entry->prev = old_prev;
|
||||
// We update the `next` link of our new entry.
|
||||
new_entry->next = location;
|
||||
// Finally, we close the link with the old insertion location element.
|
||||
location->prev = new_entry;
|
||||
}
|
||||
|
||||
/// @brief Removes an element from the list pointer, it's used when we have a possibly
|
||||
/// null list pointer and want to pop an element from it
|
||||
static inline list_head *list_head_pop(list_head *listp)
|
||||
/// @brief Removes the given entry from the list it is contained in.
|
||||
/// @param entry the entry we want to remove.
|
||||
static inline void list_head_remove(list_head *entry)
|
||||
{
|
||||
if (list_head_empty(listp))
|
||||
return NULL;
|
||||
|
||||
list_head *value = listp->next;
|
||||
list_head_del(listp->next);
|
||||
|
||||
return value;
|
||||
// Check if the element is actually in a list.
|
||||
if (!list_head_empty(entry)) {
|
||||
// We link the `previous` element to the `next` one.
|
||||
entry->prev->next = entry->next;
|
||||
// We link the `next` element to the `previous` one.
|
||||
entry->next->prev = entry->prev;
|
||||
// We initialize the entry again.
|
||||
list_head_init(entry);
|
||||
}
|
||||
}
|
||||
|
||||
static inline list_head *list_head_front(list_head *listp)
|
||||
/// @brief Removes an element from the list, it's used when we have a possibly
|
||||
/// null list pointer and want to pop an element from it.
|
||||
/// @param head the head of the list.
|
||||
/// @return a list_head pointing to the element we removed, NULL on failure.
|
||||
static inline list_head *list_head_pop(list_head *head)
|
||||
{
|
||||
return listp->next;
|
||||
// Check if the list is not empty.
|
||||
if (!list_head_empty(head)) {
|
||||
// Store the pointer.
|
||||
list_head *value = head->next;
|
||||
// Remove the element from the list.
|
||||
list_head_remove(head->next);
|
||||
// Return the pointer to the element.
|
||||
return value;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/// Merges the elements of l2, into the elements of l1.
|
||||
static inline void list_head_merge(list_head *l1, list_head *l2)
|
||||
/// @brief Append the `secondary` list at the end of the `main` list.
|
||||
/// @param main the main list where we append the secondary list.
|
||||
/// @param secondary the secondary list, which gets appended, and re-initialized as empty.
|
||||
static inline void list_head_append(list_head *main, list_head *secondary)
|
||||
{
|
||||
l1->prev->next = l2->next;
|
||||
l2->next->prev = l1->prev;
|
||||
l2->prev->next = l1;
|
||||
l1->prev = l2->prev;
|
||||
// Initialize the second list.
|
||||
list_head_init(l2);
|
||||
}
|
||||
// Check that both lists are actually filled with entries.
|
||||
if (!list_head_empty(main) && !list_head_empty(secondary)) {
|
||||
// Connect the last element of the main list to the first one of the secondary list.
|
||||
main->prev->next = secondary->next;
|
||||
// Connect the first element of the secondary list to the last one of the main list.
|
||||
secondary->next->prev = main->prev;
|
||||
|
||||
// Connect the last element of the secondary list to our main.
|
||||
secondary->prev->next = main;
|
||||
// Connect our main to the last element of the secondary list.
|
||||
main->prev = secondary->prev;
|
||||
|
||||
// Re-initialize the secondary list.
|
||||
list_head_init(secondary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
/// @brief Moves the pointer up.
|
||||
#define __MOVE_PTR_UP(type, ptr) ((ptr) += sizeof(type))
|
||||
/// @brief First, it moves the pointer down, and then it pushes the value at that memory location.
|
||||
#define PUSH_VALUE_ON_STACK(ptr, value) (__ACCESS_PTR(typeof(value), __MOVE_PTR_DOWN(typeof(value), ptr)) = (value))
|
||||
#define PUSH_VALUE_ON_STACK(ptr, value) (__ACCESS_PTR(__typeof__(value), __MOVE_PTR_DOWN(__typeof__(value), ptr)) = (value))
|
||||
/// @brief First, it access the value at the given memory location, and then it moves the pointer up.
|
||||
#define POP_VALUE_FROM_STACK(value, ptr) ({value = __ACCESS_PTR(typeof(value), ptr); __MOVE_PTR_UP(typeof(value), ptr); })
|
||||
#define POP_VALUE_FROM_STACK(value, ptr) ({value = __ACCESS_PTR(__typeof__(value), ptr); __MOVE_PTR_UP(__typeof__(value), ptr); })
|
||||
|
||||
@@ -162,4 +162,3 @@ static inline int test_bit(int offset, volatile unsigned long *base)
|
||||
// is discouraged by many C/C++ groups.
|
||||
|
||||
// == xchg/xchgl ==============================================================
|
||||
//
|
||||
@@ -100,4 +100,4 @@ void *kmalloc_ap(unsigned int sz, unsigned int *phys);
|
||||
/// @return
|
||||
//void *realloc(void *ptr, unsigned int size);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -23,29 +23,30 @@
|
||||
/// @brief Page descriptor. Use as a bitmap to understand the order of the block
|
||||
/// and if it is free or allocated.
|
||||
typedef struct page_t {
|
||||
/// Array of flags encoding also the zone number to which the page frame
|
||||
/// belongs.
|
||||
/// @brief Array of flags encoding also the zone number to which the page
|
||||
/// frame belongs.
|
||||
unsigned long flags;
|
||||
/// Page frame’s reference counter. 0 free, 1 used, 2+ copy on write
|
||||
/// @brief Page frame’s reference counter. 0 free, 1 used, 2+ copy on write
|
||||
atomic_t count;
|
||||
/// Buddy system page definition
|
||||
/// @brief Buddy system page definition
|
||||
bb_page_t bbpage;
|
||||
/// Contains pointers to the slabs doubly linked list of pages.
|
||||
/// @brief Contains pointers to the slabs doubly linked list of pages.
|
||||
list_head slabs;
|
||||
|
||||
// Slab allocator variables / Contains the total number of objects in this
|
||||
//page, 0 if not managed by the slub
|
||||
/// @brief Slab allocator variables / Contains the total number of objects
|
||||
/// in this page, 0 if not managed by the slub.
|
||||
unsigned int slab_objcnt;
|
||||
/// Tracks the number of free objects in the current page
|
||||
/// @brief Tracks the number of free objects in the current page
|
||||
unsigned int slab_objfree;
|
||||
/// Holds the first free object (if slab_objfree is > 0)
|
||||
/// @brief Holds the first free object (if slab_objfree is > 0)
|
||||
list_head slab_freelist;
|
||||
/// @brief This union can either contain the pointer to the slab main page
|
||||
/// that handles this page, or the cache that contains it.
|
||||
union {
|
||||
/// Holds the slab page used to handle this memory region (root page)
|
||||
/// @brief Holds the slab page used to handle this memory region (root
|
||||
/// page).
|
||||
struct page_t *slab_main_page;
|
||||
/// Holds the slab cache pointer on the main page
|
||||
/// @brief Holds the slab cache pointer on the main page.
|
||||
kmem_cache_t *slab_cache;
|
||||
} container;
|
||||
} page_t;
|
||||
|
||||
@@ -268,4 +268,4 @@ static inline void pause()
|
||||
// below the block of asm statements.
|
||||
// ASM(" addic. %0,%1,%2\n" : "=r"(res): "=r"(a),"r"(a))
|
||||
// This can be particularly important in cases when the code is accessing
|
||||
// shared memory.
|
||||
// shared memory.
|
||||
|
||||
@@ -111,4 +111,4 @@ int sys_waitperiod();
|
||||
/// is no longer alive.
|
||||
/// @param gid ID of the group
|
||||
/// @return 1 if the group is orphan, 0 otherwise.
|
||||
int is_orphaned_pgrp(pid_t gid);
|
||||
int is_orphaned_pgrp(pid_t gid);
|
||||
|
||||
@@ -107,4 +107,4 @@ int default_wake_function(wait_queue_entry_t *wait, unsigned mode, int sync);
|
||||
/// @param wq Waitqueue where to sleep.
|
||||
/// @return Pointer to the entry inside the wq representing the
|
||||
/// sleeping process.
|
||||
wait_queue_entry_t *sleep_on(wait_queue_head_t *wq);
|
||||
wait_queue_entry_t *sleep_on(wait_queue_head_t *wq);
|
||||
|
||||
@@ -25,4 +25,4 @@ int relocate_modules();
|
||||
|
||||
/// @brief Returns the address where the modules end.
|
||||
/// @return Address after the modules.
|
||||
uintptr_t get_address_after_modules();
|
||||
uintptr_t get_address_after_modules();
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
/// @param msg The message that has to be shown.
|
||||
void kernel_panic(const char *msg);
|
||||
|
||||
#define TODO(msg) kernel_panic(#msg);
|
||||
#define TODO(msg) kernel_panic(#msg);
|
||||
|
||||
@@ -268,13 +268,15 @@ int sys_kill(pid_t pid, int sig);
|
||||
/// @brief Sets the disposition of the signal signum to handler.
|
||||
/// @param signum The signal number.
|
||||
/// @param handler The handler for the signal.
|
||||
/// @param sigreturn_addr The address of the sigreturn function.
|
||||
/// @return The previous value of the signal handler, or SIG_ERR on error.
|
||||
sighandler_t sys_signal(int signum, sighandler_t handler, uint32_t sigreturn_addr);
|
||||
|
||||
/// @brief Examine and change a signal action.
|
||||
/// @param signum Specifies the signal and can be any valid signal except SIGKILL and SIGSTOP.
|
||||
/// @param act If non-NULL, the new action for signal signum is installed from act.
|
||||
/// @param act If non-NULL, the new action for signal signum is installed from act.
|
||||
/// @param oldact If non-NULL, the previous action is saved in oldact.
|
||||
/// @param sigreturn_addr The address of the sigreturn function.
|
||||
/// @return returns 0 on success; on error, -1 is returned, and errno is set to indicate the error.
|
||||
int sys_sigaction(int signum, const sigaction_t *act, sigaction_t *oldact, uint32_t sigreturn_addr);
|
||||
|
||||
@@ -321,4 +323,4 @@ int sigdelset(sigset_t *set, int signum);
|
||||
/// @param signum The signalt to handle.
|
||||
/// @return 1 if signum is a member of set,
|
||||
/// 0 if signum is not a member, and -1 on error.
|
||||
int sigismember(sigset_t *set, int signum);
|
||||
int sigismember(sigset_t *set, int signum);
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
#define OS_MAJOR_VERSION 0
|
||||
|
||||
/// Minor version of the operating system.
|
||||
#define OS_MINOR_VERSION 4
|
||||
#define OS_MINOR_VERSION 5
|
||||
|
||||
/// Micro version of the operating system.
|
||||
#define OS_MICRO_VERSION 0
|
||||
#define OS_MICRO_VERSION 4
|
||||
|
||||
/// Helper to transform the given argument into a string.
|
||||
#define OS_STR_HELPER(x) #x
|
||||
|
||||
+3
-6
@@ -1,20 +1,17 @@
|
||||
OUTPUT_FORMAT("elf")
|
||||
OUTPUT_ARCH(i386)
|
||||
OUTPUT_FORMAT("elf32-i386")
|
||||
|
||||
ENTRY(kmain)
|
||||
|
||||
KERNEL_VIRTUAL_ADDRESS = 0xC0000000;
|
||||
|
||||
MEMORY {
|
||||
USER_SPACE : ORIGIN = 0x00000000, LENGTH = 3072M
|
||||
KERNEL_LOWMEM : ORIGIN = KERNEL_VIRTUAL_ADDRESS, LENGTH = 896M
|
||||
KERNEL_LOWMEM : ORIGIN = 0xC0000000, LENGTH = 896M
|
||||
KERNEL_HIGHMEM : ORIGIN = 0xF8000000, LENGTH = 128M
|
||||
}
|
||||
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = KERNEL_VIRTUAL_ADDRESS;
|
||||
. = 0xC0000000;
|
||||
/* Put the .text section. */
|
||||
.text . : AT(ADDR(.text))
|
||||
{
|
||||
|
||||
+1
-1
@@ -292,4 +292,4 @@ void boot_main(uint32_t magic, multiboot_info_t *header, uint32_t esp)
|
||||
boot_kernel(boot_info.stack_base, elf_hdr->entry, &boot_info);
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -192,4 +192,4 @@ void gdt_set_gate(uint8_t index, uint32_t base, uint32_t limit, uint8_t access,
|
||||
// and the data selectors ds, ss, ..., should store 35 (0x23):
|
||||
// | 0000000000100| 0| 11|
|
||||
// | index 4 (data) | GDT| non-privileged|
|
||||
//
|
||||
//
|
||||
|
||||
@@ -51,7 +51,7 @@ static inline irq_struct_t *__irq_struct_alloc()
|
||||
/// @brief Destroys an irq struct.
|
||||
static inline void __irq_struct_dealloc(irq_struct_t *irq_struct)
|
||||
{
|
||||
list_head_del(&irq_struct->siblings);
|
||||
list_head_remove(&irq_struct->siblings);
|
||||
kmem_cache_free(irq_struct);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ int irq_install_handler(unsigned i, interrupt_handler_t handler, char *descripti
|
||||
irq_struct->description = description;
|
||||
irq_struct->handler = handler;
|
||||
// Add the handler to the list of his siblings.
|
||||
list_head_add_tail(&irq_struct->siblings, &shared_interrupt_handlers[i]);
|
||||
list_head_insert_before(&irq_struct->siblings, &shared_interrupt_handlers[i]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ int irq_uninstall_handler(unsigned i, interrupt_handler_t handler)
|
||||
irq_struct_t *irq_struct = list_entry(it, irq_struct_t, siblings);
|
||||
assert(irq_struct && "Something went wrong.");
|
||||
if (irq_struct->handler == handler) {
|
||||
list_head_del(&irq_struct->siblings);
|
||||
list_head_remove(&irq_struct->siblings);
|
||||
}
|
||||
__irq_struct_dealloc(irq_struct);
|
||||
}
|
||||
|
||||
+11
-11
@@ -29,23 +29,23 @@ uint8_t saves[512] __attribute__((aligned(16)));
|
||||
/// @param cw What to set the control word to.
|
||||
static inline void __set_fpu_cw(const uint16_t cw)
|
||||
{
|
||||
asm volatile("fldcw %0" ::"m"(cw));
|
||||
__asm__ __volatile__("fldcw %0" ::"m"(cw));
|
||||
}
|
||||
|
||||
/// @brief Enable the FPU and SSE.
|
||||
static inline void __enable_fpu()
|
||||
{
|
||||
asm volatile("clts");
|
||||
__asm__ __volatile__("clts");
|
||||
size_t t;
|
||||
asm volatile("mov %%cr0, %0"
|
||||
__asm__ __volatile__("mov %%cr0, %0"
|
||||
: "=r"(t));
|
||||
t &= ~(1U << 2U);
|
||||
t |= (1U << 1U);
|
||||
asm volatile("mov %0, %%cr0" ::"r"(t));
|
||||
asm volatile("mov %%cr4, %0"
|
||||
__asm__ __volatile__("mov %0, %%cr0" ::"r"(t));
|
||||
__asm__ __volatile__("mov %%cr4, %0"
|
||||
: "=r"(t));
|
||||
t |= 3U << 9U;
|
||||
asm volatile("mov %0, %%cr4" ::"r"(t));
|
||||
__asm__ __volatile__("mov %0, %%cr4" ::"r"(t));
|
||||
}
|
||||
|
||||
/// Disable FPU and SSE so it traps to the kernel.
|
||||
@@ -53,12 +53,12 @@ static inline void __disable_fpu()
|
||||
{
|
||||
size_t t;
|
||||
|
||||
asm volatile("mov %%cr0, %0"
|
||||
__asm__ __volatile__("mov %%cr0, %0"
|
||||
: "=r"(t));
|
||||
|
||||
t |= 1U << 3U;
|
||||
|
||||
asm volatile("mov %0, %%cr0" ::"r"(t));
|
||||
__asm__ __volatile__("mov %0, %%cr0" ::"r"(t));
|
||||
}
|
||||
|
||||
/// @brief Restore the FPU for a process.
|
||||
@@ -68,7 +68,7 @@ static inline void __restore_fpu(task_struct *proc)
|
||||
|
||||
memcpy(&saves, (uint8_t *)&proc->thread.fpu_register, 512);
|
||||
|
||||
asm volatile("fxrstor (%0)" ::"r"(saves));
|
||||
__asm__ __volatile__("fxrstor (%0)" ::"r"(saves));
|
||||
}
|
||||
|
||||
/// Save the FPU for a process.
|
||||
@@ -76,7 +76,7 @@ static inline void __save_fpu(task_struct *proc)
|
||||
{
|
||||
assert(proc && "Trying to save FPU of NULL process.");
|
||||
|
||||
asm volatile("fxsave (%0)" ::"r"(saves));
|
||||
__asm__ __volatile__("fxsave (%0)" ::"r"(saves));
|
||||
|
||||
memcpy((uint8_t *)&proc->thread.fpu_register, &saves, 512);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ static inline void __save_fpu(task_struct *proc)
|
||||
/// Initialize the FPU.
|
||||
static inline void __init_fpu()
|
||||
{
|
||||
asm volatile("fninit");
|
||||
__asm__ __volatile__("fninit");
|
||||
}
|
||||
|
||||
/// Kernel trap for FPU usage when FPU is disabled.
|
||||
|
||||
@@ -496,4 +496,4 @@ void pci_debug_scan()
|
||||
pr_default("--------------------------------------------------\n");
|
||||
}
|
||||
|
||||
///! @endcond
|
||||
///! @endcond
|
||||
|
||||
@@ -1159,4 +1159,4 @@ int ata_finalize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -65,4 +65,4 @@ int fdc_finalize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -301,4 +301,4 @@ int keyboard_finalize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -240,4 +240,4 @@ void init_keymaps()
|
||||
keymaps[KEYMAP_US][KEY_KP_DEC] = (keymap_t){ 0x532E, 0x532E, 0x5300, 0x5300 }; // 0x0053
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -214,4 +214,4 @@ int mouse_finalize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -328,4 +328,4 @@ int ps2_initialize()
|
||||
pr_debug("Status : %s (%3d | %02x)\n", dec_to_binary(status, 8), status, status);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +160,4 @@ int rtc_finalize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// @}
|
||||
/// @}
|
||||
|
||||
@@ -453,4 +453,4 @@ const char *elf_symbol_bind_to_string(int bind)
|
||||
if (bind == STB_WEAK)
|
||||
return "WEAK";
|
||||
return "-1";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,6 +620,7 @@ static void ext2_dump_inode(ext2_inode_t *inode)
|
||||
pr_debug("Symlink : %s\n", inode->data.symlink);
|
||||
pr_debug("Generation : %u file_acl : %u dir_acl : %u\n",
|
||||
inode->generation, inode->file_acl, inode->dir_acl);
|
||||
(void)timeinfo;
|
||||
}
|
||||
|
||||
/// @brief Dumps on debugging output the dirent.
|
||||
@@ -2259,7 +2260,7 @@ static vfs_file_t *ext2_creat(const char *path, mode_t permission)
|
||||
goto close_parent_return_null;
|
||||
}
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&file->siblings, &fs->opened_files);
|
||||
list_head_insert_before(&file->siblings, &fs->opened_files);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
@@ -2378,7 +2379,7 @@ static vfs_file_t *ext2_open(const char *path, int flags, mode_t mode)
|
||||
return NULL;
|
||||
}
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&file->siblings, &fs->opened_files);
|
||||
list_head_insert_before(&file->siblings, &fs->opened_files);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
@@ -2487,7 +2488,7 @@ static int ext2_close(vfs_file_t *file)
|
||||
}
|
||||
pr_debug("ext2_close(ino: %d, file: \"%s\")\n", file->ino, file->name);
|
||||
// Remove the file from the list of opened files.
|
||||
list_head_del(&file->siblings);
|
||||
list_head_remove(&file->siblings);
|
||||
// Free the cache.
|
||||
kmem_cache_free(file);
|
||||
return 0;
|
||||
@@ -3040,7 +3041,7 @@ static vfs_file_t *ext2_mount(vfs_file_t *block_device, const char *path)
|
||||
goto free_all;
|
||||
}
|
||||
// Add the root to the list of opened files.
|
||||
list_head_add_tail(&fs->root->siblings, &fs->opened_files);
|
||||
list_head_insert_before(&fs->root->siblings, &fs->opened_files);
|
||||
|
||||
// Dump the filesystem details for debugging.
|
||||
ext2_dump_filesystem(fs);
|
||||
|
||||
@@ -31,4 +31,4 @@ int sys_ioctl(int fd, int request, void *data)
|
||||
|
||||
// Perform the ioctl.
|
||||
return vfs_ioctl(file, request, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,4 +60,4 @@ int sys_creat(const char *path, mode_t mode)
|
||||
|
||||
// Return the file descriptor and increment it.
|
||||
return fd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ static inline procfs_file_t *procfs_create_file(const char *path, unsigned flags
|
||||
// List of all the PROCFS files.
|
||||
list_head_init(&procfs_file->siblings);
|
||||
// Add the file to the list of opened files.
|
||||
list_head_add_tail(&procfs_file->siblings, &fs.files);
|
||||
list_head_insert_before(&procfs_file->siblings, &fs.files);
|
||||
// Time of last access.
|
||||
procfs_file->atime = sys_time(NULL);
|
||||
// Time of last data modification.
|
||||
@@ -282,7 +282,7 @@ static inline int procfs_destroy_file(procfs_file_t *procfs_file)
|
||||
}
|
||||
pr_debug("procfs_destroy_file(%p) `%s`\n", procfs_file, procfs_file->name);
|
||||
// Remove the file from the list of opened files.
|
||||
list_head_del(&procfs_file->siblings);
|
||||
list_head_remove(&procfs_file->siblings);
|
||||
// Free the cache.
|
||||
kmem_cache_free(procfs_file);
|
||||
// Decrease the number of files.
|
||||
@@ -467,7 +467,7 @@ static vfs_file_t *procfs_open(const char *path, int flags, mode_t mode)
|
||||
// Update file access.
|
||||
procfs_file->atime = sys_time(NULL);
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&vfs_file->siblings, &procfs_file->files);
|
||||
list_head_insert_before(&vfs_file->siblings, &procfs_file->files);
|
||||
return vfs_file;
|
||||
}
|
||||
// Check if the user did not want to open a directory, but it is.
|
||||
@@ -486,7 +486,7 @@ static vfs_file_t *procfs_open(const char *path, int flags, mode_t mode)
|
||||
// Update file access.
|
||||
procfs_file->atime = sys_time(NULL);
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&vfs_file->siblings, &procfs_file->files);
|
||||
list_head_insert_before(&vfs_file->siblings, &procfs_file->files);
|
||||
return vfs_file;
|
||||
}
|
||||
// When both O_CREAT and O_DIRECTORY are specified in flags and the file
|
||||
@@ -508,7 +508,7 @@ static vfs_file_t *procfs_open(const char *path, int flags, mode_t mode)
|
||||
return NULL;
|
||||
}
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&vfs_file->siblings, &procfs_file->files);
|
||||
list_head_insert_before(&vfs_file->siblings, &procfs_file->files);
|
||||
pr_debug("Created file `%s`.\n", path);
|
||||
return vfs_file;
|
||||
}
|
||||
@@ -523,7 +523,7 @@ static int procfs_close(vfs_file_t *file)
|
||||
assert(file && "Received null file.");
|
||||
//pr_debug("procfs_close(%p): VFS file : %p\n", file, file);
|
||||
// Remove the file from the list of `files` inside its corresponding `procfs_file_t`.
|
||||
list_head_del(&file->siblings);
|
||||
list_head_remove(&file->siblings);
|
||||
// Free the memory of the file.
|
||||
kmem_cache_free(file);
|
||||
return 0;
|
||||
@@ -778,7 +778,7 @@ static vfs_file_t *procfs_mount_callback(const char *path, const char *device)
|
||||
vfs_file_t *vfs_file = procfs_create_file_struct(procfs_file);
|
||||
assert(vfs_file && "Failed to create vfs_file.");
|
||||
// Add the vfs_file to the list of associated files.
|
||||
list_head_add_tail(&vfs_file->siblings, &procfs_file->files);
|
||||
list_head_insert_before(&vfs_file->siblings, &procfs_file->files);
|
||||
// Initialize the proc_root.
|
||||
return vfs_file;
|
||||
}
|
||||
@@ -949,4 +949,4 @@ int proc_destroy_entry(const char *name, proc_dir_entry_t *parent)
|
||||
return -ENOENT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user