25 Commits

Author SHA1 Message Date
Enrico Fraccaroli 510a2c0e73 Merge branch 'hotfix/v0.5.4' 2022-12-19 12:21:50 +01:00
Enrico Fraccaroli 4f650b3704 Update version. 2022-12-19 12:21:40 +01:00
Enrico Fraccaroli 679b943e0e Merge branch 'release/v0.5.3' 2022-12-19 11:59:15 +01:00
Enrico Fraccaroli 2d5e3ad41f Update version. 2022-12-19 11:59:03 +01:00
Enrico Fraccaroli 48ac939566 Set block size of generated ext2 filesystem to 4096. 2022-12-19 11:56:22 +01:00
Enrico Fraccaroli 60873784d2 Fix how we retrieve the first element of the list. 2022-12-19 11:55:33 +01:00
Enrico Fraccaroli f643e11212 Disable missing-braces warning. 2022-12-13 17:01:26 -05:00
Enrico Fraccaroli e654600c27 Deal with an unused variable. 2022-12-13 16:58:30 -05:00
Enrico Fraccaroli d499a07b0f Remove -Wno-unused-but-set-variable flag. 2022-12-13 16:56:14 -05:00
Enrico Fraccaroli 918b00e43d Force linker to be ld. 2022-12-13 16:47:08 -05:00
Enrico Fraccaroli 3d3c713828 Add verbose option 2022-12-13 16:02:21 -05:00
Enrico Fraccaroli 55932ce89e [WIP] Test extensive workflow. 2022-12-13 15:54:29 -05:00
Enrico Fraccaroli a572db52fd Add newline at the end of the files. Add -Wno-unused-command-line-argument to programs compilation flow, to support clang. 2022-12-13 15:44:31 -05:00
Enrico Fraccaroli 3f73b8d8a0 Add newline at the end of the files. Use built in keywords properly. 2022-12-13 14:31:27 -05:00
Enrico Fraccaroli 0965669f4b Add newline at the end of the files. 2022-12-13 14:25:16 -05:00
Enrico Fraccaroli 565df959b1 Simplify doxygen documentation building. 2022-12-12 22:38:07 -05:00
Enrico Fraccaroli 45376a2bb3 [Important] Extend main README. Write some more man entries. 2022-12-12 22:21:39 -05:00
Enrico Fraccaroli de9daa4a85 Add some missing documentation. There is still some work to do. 2022-12-09 11:35:30 -05:00
Enrico Fraccaroli 8e1424fbec Update comments. 2022-12-09 11:03:50 -05:00
Enrico Fraccaroli 79f150a3d5 Update readme. Add SCHEDULER_AEDF to cmake options. Add exercise template inside the scheduler_algorithm.c file. 2022-12-09 10:58:09 -05:00
Enrico Fraccaroli b61655b9de Merge tag 'v0.5.2' into develop
Debugging hotfix
2022-12-08 13:23:31 -05:00
Enrico Fraccaroli 3cf8ae04f1 Merge branch 'hotfix/v0.5.2' 2022-12-08 13:23:10 -05:00
Enrico Fraccaroli 25b4a34f1b Update version. 2022-12-08 13:23:03 -05:00
Enrico Fraccaroli b1f3169310 Align README and debugging procedure. 2022-12-08 13:20:17 -05:00
Enrico Fraccaroli 26daf96b90 Merge tag 'v0.5.1' into develop
MentOS version 0.5.1
2022-12-08 11:28:48 -05:00
143 changed files with 813 additions and 5070 deletions
+81 -43
View File
@@ -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
View File
@@ -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
+37 -24
View File
@@ -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 {
+290
View File
@@ -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)
+44 -13
View File
@@ -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;
-37
View File
@@ -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)
-2530
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-40
View File
@@ -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 © 20142022 the MentOs-Team, and numerous contributors.<br>
It is available for use and modification under the&#160;
<a href="$relpath^md_LICENSE.html">MIT License</a>.<br>
</li>
</ul>
<hr class="footer" />
<address class="footer">
$generatedby&#160;
<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>
-66
View File
@@ -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-->&#160;<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

+8
View File
@@ -0,0 +1,8 @@
SYNOPSIS
cat [FILE]
DESCRIPTION
Prints the content of the given file.
OPTIONS
-h --help : shows command help.
+5
View File
@@ -0,0 +1,5 @@
SYNOPSIS
clear
DESCRIPTION
Clears the screen.
+5
View File
@@ -0,0 +1,5 @@
SYNOPSIS
cpuid
DESCRIPTION
Not currently implemented.
+5
View File
@@ -0,0 +1,5 @@
SYNOPSIS
date
DESCRIPTION
Shows the current date.
+6
View File
@@ -0,0 +1,6 @@
SYNOPSIS
echo [STRING]
DESCRIPTION
Displays a line of text.
+3 -5
View File
@@ -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
View File
@@ -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")
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -21,4 +21,4 @@ struct ipc_perm {
unsigned short mode;
/// Sequence number.
unsigned short __seq;
};
};
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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);
+1 -1
View File
@@ -124,4 +124,4 @@
}
#undef RING_BUFFER_ALLOC
#undef RING_BUFFER_FREE
#undef RING_BUFFER_FREE
+1 -1
View File
@@ -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
View File
@@ -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);
+5 -1
View File
@@ -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
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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);
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
}
+1 -2
View File
@@ -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
View File
@@ -137,4 +137,4 @@ char *realpath(const char *path, char *resolved)
else
resolved[1] = '\0';
return resolved;
}
}
+7
View File
@@ -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)) {
+5
View File
@@ -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
View File
@@ -205,4 +205,4 @@ char *fgets(char *buf, int n, int fd)
if (p == buf || c == EOF)
return NULL;
return (p);
}
}
+3
View File
@@ -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));
+1 -1
View File
@@ -33,4 +33,4 @@ int rmdir(const char *path)
return mountpoint_list[mp_id].dir_op.rmdir_f(absolute_path);
}
#endif
#endif
+1 -1
View File
@@ -34,4 +34,4 @@ int tcsetattr(int fd, int optional_actions, const termios_t *termios_p)
retval = -1;
}
return retval;
}
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
View File
@@ -689,4 +689,4 @@ int fprintf(int fd, const char *fmt, ...)
return len;
}
return -1;
}
}
+2 -2
View File
@@ -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
View File
@@ -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))
{
+1 -1
View File
@@ -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);
/// @}
/// @}
/// @}
+1 -1
View File
@@ -60,4 +60,4 @@ typedef struct idt_pointer_t {
void init_idt();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -97,4 +97,4 @@ extern void isq_handler(pt_regs *f);
//==============================================================================
/// @}
/// @}
/// @}
+1 -1
View File
@@ -60,4 +60,4 @@ void tss_init(uint8_t idx, uint32_t ss0);
void tss_set_stack(uint32_t kss, uint32_t kesp);
/// @}
/// @}
/// @}
+1 -1
View File
@@ -130,4 +130,4 @@ void unswitch_fpu();
int fpu_install();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -346,4 +346,4 @@ int pci_get_interrupt(uint32_t device);
void pci_debug_scan();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -26,4 +26,4 @@ int ata_initialize();
int ata_finalize();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -19,4 +19,4 @@ int fdc_initialize();
int fdc_finalize();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -49,4 +49,4 @@ int keyboard_initialize();
int keyboard_finalize();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -161,4 +161,4 @@ void init_keymaps();
/// @}
/// @}
/// @}
/// @}
+1 -1
View File
@@ -24,4 +24,4 @@ int mouse_initialize();
int mouse_finalize();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -26,4 +26,4 @@ int rtc_initialize();
int rtc_finalize();
/// @}
/// @}
/// @}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -290,4 +290,4 @@ palette_entry_t ansi_256_palette[256] = {
{ 218, 218, 218 }, // Grey85
{ 228, 228, 228 }, // Grey89
{ 238, 238, 238 }, // Grey93
};
};
+2 -3
View File
@@ -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))))
+2 -2
View File
@@ -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); })
-1
View File
@@ -162,4 +162,3 @@ static inline int test_bit(int offset, volatile unsigned long *base)
// is discouraged by many C/C++ groups.
// == xchg/xchgl ==============================================================
//
+1 -1
View File
@@ -100,4 +100,4 @@ void *kmalloc_ap(unsigned int sz, unsigned int *phys);
/// @return
//void *realloc(void *ptr, unsigned int size);
#endif
#endif
+12 -11
View File
@@ -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 frames reference counter. 0 free, 1 used, 2+ copy on write
/// @brief Page frames 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;
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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);
+4 -2
View File
@@ -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);
+1 -1
View File
@@ -21,7 +21,7 @@
#define OS_MINOR_VERSION 5
/// Micro version of the operating system.
#define OS_MICRO_VERSION 1
#define OS_MICRO_VERSION 4
/// Helper to transform the given argument into a string.
#define OS_STR_HELPER(x) #x
+3 -6
View File
@@ -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
View File
@@ -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);
}
/// @}
/// @}
+1 -1
View File
@@ -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|
//
//
+11 -11
View File
@@ -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.
+1 -1
View File
@@ -496,4 +496,4 @@ void pci_debug_scan()
pr_default("--------------------------------------------------\n");
}
///! @endcond
///! @endcond
+1 -1
View File
@@ -1159,4 +1159,4 @@ int ata_finalize()
return 0;
}
/// @}
/// @}
+1 -1
View File
@@ -65,4 +65,4 @@ int fdc_finalize()
return 0;
}
/// @}
/// @}
+1 -1
View File
@@ -301,4 +301,4 @@ int keyboard_finalize()
return 0;
}
/// @}
/// @}
+1 -1
View File
@@ -240,4 +240,4 @@ void init_keymaps()
keymaps[KEYMAP_US][KEY_KP_DEC] = (keymap_t){ 0x532E, 0x532E, 0x5300, 0x5300 }; // 0x0053
}
/// @}
/// @}
+1 -1
View File
@@ -214,4 +214,4 @@ int mouse_finalize()
return 0;
}
/// @}
/// @}
+1 -1
View File
@@ -328,4 +328,4 @@ int ps2_initialize()
pr_debug("Status : %s (%3d | %02x)\n", dec_to_binary(status, 8), status, status);
return 0;
}
}
+1 -1
View File
@@ -160,4 +160,4 @@ int rtc_finalize()
return 0;
}
/// @}
/// @}
+1 -1
View File
@@ -453,4 +453,4 @@ const char *elf_symbol_bind_to_string(int bind)
if (bind == STB_WEAK)
return "WEAK";
return "-1";
}
}
+1
View File
@@ -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.
+1 -1
View File
@@ -31,4 +31,4 @@ int sys_ioctl(int fd, int request, void *data)
// Perform the ioctl.
return vfs_ioctl(file, request, data);
}
}
+1 -1
View File
@@ -60,4 +60,4 @@ int sys_creat(const char *path, mode_t mode)
// Return the file descriptor and increment it.
return fd;
}
}
+1 -1
View File
@@ -949,4 +949,4 @@ int proc_destroy_entry(const char *name, proc_dir_entry_t *parent)
return -ENOENT;
}
return 0;
}
}
+1 -1
View File
@@ -93,4 +93,4 @@ off_t sys_lseek(int fd, off_t offset, int whence)
}
// Perform the lseek.
return vfs_lseek(vfd->file_struct, offset, whence);
}
}
+1 -1
View File
@@ -42,4 +42,4 @@ int sys_fstat(int fd, stat_t *buf)
}
return vfs_fstat(vfd->file_struct, buf);
}
}
+4 -1
View File
@@ -229,6 +229,7 @@ static void __print_tvec_slots(tvec_base_t *base, int tv_index)
}
pr_debug("base->tv%d.vec:\n\t%s\n", tv_index, result);
(void) result;
}
/// Dump all timer vector in base
@@ -327,6 +328,7 @@ static void __rem_timer_tvec_base(tvec_base_t *base, struct timer_list *timer)
int index = 0, tv_index = 0;
__find_tvec(base, timer, &index, &tv_index);
// TODO: Check why we do not use vec.
struct list_head *vec;
switch (tv_index) {
case 1:
@@ -352,6 +354,7 @@ static void __rem_timer_tvec_base(tvec_base_t *base, struct timer_list *timer)
#ifdef ENABLE_REAL_TIMER_SYSTEM_DUMP
__dump_all_tvec_slots(base);
#endif
(void)vec;
}
/// Move all timers from tv up one level
@@ -768,4 +771,4 @@ void update_process_profiling_timer(task_struct *proc)
proc->it_prof_value = 0;
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More