Merge remote-tracking branch 'Fennix/master'

This commit is contained in:
EnderIce2 2024-11-20 04:58:46 +02:00
commit d246932660
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
64 changed files with 7233 additions and 0 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,13 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: EnderIce2 # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

33
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,33 @@
---
name: Bug report / crash
about: Create a report to help find bugs
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshot or Video**
If applicable, add screenshots or videos to help explain your problem.
**Serial Port Output**
Serial port output (file .log or .txt).
**System Information**
- CPU:
- RAM:
- GPU:
- Motherboard:
- Virtual Machine:
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

339
.github/workflows/makefile.yml vendored Normal file
View File

@ -0,0 +1,339 @@
name: Build OS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
deploydoc:
name: Deploy Documentation to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Doxygen
run: sudo apt-get install doxygen make -y
- name: Generate Documentation
run: make doxygen
- name: Copy GitHub Pages Website
run: cp -r tools/website/* doxygen-doc/
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: doxygen-doc
buildcompiler:
name: Build Cross-Compiler & Toolchain
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache cross Folder
id: cache-cross
uses: actions/cache@v3
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Update System
if: steps.cache-cross.outputs.cache-hit != 'true'
run: sudo apt-get update
- name: Install GCC Dependencies
if: steps.cache-cross.outputs.cache-hit != 'true'
run: sudo apt install build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libzstd-dev libisl-dev autoconf m4 automake gettext gperf dejagnu guile-3.0 guile-3.0-dev expect tcl autogen tex-common sphinx-common git ssh diffutils patch -y
- name: Clone All
if: steps.cache-cross.outputs.cache-hit != 'true'
run: make --quiet -C tools __clone_all_no_qemu
- name: Compile Binutils amd64
if: steps.cache-cross.outputs.cache-hit != 'true'
run: make --quiet -C tools do_binutils_64
- name: Compile Binutils i386
if: steps.cache-cross.outputs.cache-hit != 'true'
run: make --quiet -C tools do_binutils_32
- name: Compile GCC amd64
if: steps.cache-cross.outputs.cache-hit != 'true'
run: make --quiet -C tools do_gcc_64
- name: Compile GCC i386
if: steps.cache-cross.outputs.cache-hit != 'true'
run: make --quiet -C tools do_gcc_32
- name: Clean Up
if: steps.cache-cross.outputs.cache-hit != 'true'
run: |
cd tools
rm -rf binutils-gdb gcc build-binutils64 build-gcc64 build-binutils32 build-gcc32
compilegnuefi:
name: Build GNU-EFI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache gnu-efi Folder
id: cache-gnuefi
uses: actions/cache@v3
with:
path: Lynx/gnu-efi
key: ${{ runner.os }}-gnuefi-${{ hashFiles('Lynx/Makefile') }}
- name: Update System
if: steps.cache-gnuefi.outputs.cache-hit != 'true'
run: sudo apt-get update
- name: Install MinGW compiler
if: steps.cache-gnuefi.outputs.cache-hit != 'true'
run: sudo apt-get install make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 -y
- name: Get GNU-EFI source code and compile it
if: steps.cache-gnuefi.outputs.cache-hit != 'true'
run: make --quiet -C Lynx prepare
analyze:
name: Analyze with CodeQL
runs-on: ubuntu-latest
needs: [buildcompiler, compilegnuefi]
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Install Packages
run: |
sudo apt-get update
sudo apt-get install rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo -y
make --quiet -C tools do_limine
make --quiet -C Drivers prepare
make --quiet -C Userspace prepare
make --quiet -C Lynx prepare
make --quiet -C Kernel prepare
- name: Cache cross
id: cache-cross
uses: actions/cache@v3
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Cache gnuefi
id: cache-gnuefi
uses: actions/cache@v3
with:
path: Lynx/gnu-efi
key: ${{ runner.os }}-gnuefi-${{ hashFiles('Lynx/Makefile') }}
- name: Build OS
run: |
make build_lynx
make build_userspace
make build_drivers
make build_kernel
make build_userspace
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
compile64:
name: Build amd64
runs-on: ubuntu-latest
needs: [buildcompiler, compilegnuefi]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Update & Install Required Packages
run: |
sudo apt-get update
sudo apt-get install rustc xorriso mtools genisoimage ovmf nasm doxygen make meson gcc-10 g++-10 gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 -y
make --quiet -C tools do_limine
make --quiet -C Drivers prepare
make --quiet -C Userspace prepare
make --quiet -C Lynx prepare
make --quiet -C Kernel prepare
- name: Cache cross Folder
id: cache-cross
uses: actions/cache@v3
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Cache gnu-efi Folder
id: cache-gnuefi
uses: actions/cache@v3
with:
path: Lynx/gnu-efi
key: ${{ runner.os }}-gnuefi-${{ hashFiles('Lynx/Makefile') }}
- name: Configure Makefile.conf
run: sed -i 's/.*OSARCH = .*/OSARCH = amd64/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- name: Compile Debug and Release ISO
run: |
make build
mv Fennix.iso Fennix-debug.iso
make clean
sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
make build
mv Fennix.iso Fennix-release.iso
- name: Upload Artifact (Fennix-debug.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-amd64-debug
path: Fennix-debug.iso
- name: Upload Artifact (Fennix-release.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-amd64-release
path: Fennix-release.iso
compile32:
name: Build i386
runs-on: ubuntu-latest
needs: [buildcompiler, compilegnuefi]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Update & Install Required Packages
run: |
sudo apt-get update
sudo apt-get install rustc xorriso mtools genisoimage ovmf nasm doxygen make meson gcc-10 g++-10 gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 -y
make --quiet -C tools do_limine
make --quiet -C Drivers prepare
make --quiet -C Userspace prepare
make --quiet -C Lynx prepare
make --quiet -C Kernel prepare
- name: Cache cross Folder
id: cache-cross
uses: actions/cache@v3
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Cache gnu-efi Folder
id: cache-gnuefi
uses: actions/cache@v3
with:
path: Lynx/gnu-efi
key: ${{ runner.os }}-gnuefi-${{ hashFiles('Lynx/Makefile') }}
- name: Configure Makefile.conf
run: sed -i 's/.*OSARCH = .*/OSARCH = i386/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- name: Compile Debug and Release ISO
run: |
make build
mv Fennix.iso Fennix-debug.iso
make clean
sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
make build
mv Fennix.iso Fennix-release.iso
- name: Upload Artifact (Fennix-debug.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-i386-debug
path: Fennix-debug.iso
- name: Upload Artifact (Fennix-release.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-i386-release
path: Fennix-release.iso
compilearm64:
if: ${{ false }} # Disabled until we can get it to work
name: Build aarch64
runs-on: ubuntu-latest
needs: [buildcompiler, compilegnuefi]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Update & Install Required Packages
run: |
sudo apt-get update
sudo apt-get install rustc xorriso mtools genisoimage ovmf nasm doxygen make meson gcc-10 g++-10 gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 -y
make --quiet -C tools do_limine
make --quiet -C Drivers prepare
make --quiet -C Userspace prepare
make --quiet -C Lynx prepare
make --quiet -C Kernel prepare
- name: Cache cross Folder
id: cache-cross
uses: actions/cache@v3
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Cache gnu-efi Folder
id: cache-gnuefi
uses: actions/cache@v3
with:
path: Lynx/gnu-efi
key: ${{ runner.os }}-gnuefi-${{ hashFiles('Lynx/Makefile') }}
- name: Configure Makefile.conf
run: sed -i 's/.*OSARCH = .*/OSARCH = aarch64/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- name: Compile Debug and Release ISO
run: |
make build
mv Fennix.iso Fennix-debug.iso
make clean
sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
make build
mv Fennix.iso Fennix-release.iso
- name: Upload Artifact (Fennix-debug.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-aarch64-debug
path: Fennix-debug.iso
- name: Upload Artifact (Fennix-release.iso)
uses: actions/upload-artifact@v3
with:
name: Fennix-aarch64-release
path: Fennix-release.iso

30
.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
iso_tmp_data
initrd_tmp_data
initrd/usr/include/*
!initrd/usr/include/.gitkeep
tools/*
!tools/ExtMemDbg
!tools/stage2_eltorito
!tools/*.md
!tools/*.css
!tools/README.md
!tools/website
!tools/Makefile
!tools/*.c
!tools/*.cpp
!tools/*.cfg
!tools/SSDT1.dat
doxygen-doc
initrd.tar
.dccache
*.log
*.log.*
*.img
*.qcow2
*.iso
*.drv
*.fex
*.a
*.so
*.o
*.dmp

147
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,147 @@
image: ubuntu:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- prepare-environment
- generate-docs
- build-compiler
- compile-gnuefi
- build-os
prepare:
stage: prepare-environment
script:
- apt-get update
- apt-get install -y git
- git submodule update --init --recursive
- echo "TOOLS_LOCK_HASH=$(git hash-object tools/Makefile)" >> vars.env
- echo "GNUEFI_LOCK_HASH=$(git hash-object Lynx/UEFI/Makefile)" >> vars.env
artifacts:
reports:
dotenv: vars.env
docs:
stage: generate-docs
script:
- apt-get update
- apt-get install -y doxygen make
- make doxygen
- cp -r tools/website/* doxygen-doc/
artifacts:
paths:
- doxygen-doc/
compiler:
stage: build-compiler
cache:
key: $PACKAGE_LOCK_HASH
paths:
- tools/cross/
script:
- apt-get update
- ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
- DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libzstd-dev libisl-dev autoconf m4 automake gettext gperf dejagnu guile-3.0 guile-3.0-dev expect tcl autogen tex-common sphinx-common git ssh diffutils patch
- make --quiet -C tools __clone_all_no_qemu
- make --quiet -C tools do_binutils64
- make --quiet -C tools do_binutils32
- make --quiet -C tools do_binutilsarm64
- make --quiet -C tools do_gcc64
- make --quiet -C tools do_gcc32
- make --quiet -C tools do_gccarm64
- make --quiet -C tools do_toolchain_binutils64
- make --quiet -C tools do_toolchain_gcc64
- make --quiet -C tools do_toolchain_binutils32
- make --quiet -C tools do_toolchain_gcc32
- cd tools && rm -rf binutils-gdb gcc qemu build-binutilsamd64 build-binutilsi386 build-binutilsarm64 build-gccamd64 build-gcci386 build-gccarm64 build-toolchain-binutils64 build-toolchain-gcc64 build-toolchain-binutils32 build-toolchain-gcc32
artifacts:
paths:
- tools/cross/
gnuefi:
stage: compile-gnuefi
cache:
key: $GNUEFI_LOCK_HASH
paths:
- Lynx/gnu-efi/
script:
- apt-get update
- apt-get install -y make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
- make --quiet -C Lynx prepare
artifacts:
paths:
- Lynx/gnu-efi/
build64:
stage: build-os
dependencies:
- compiler
- gnuefi
script:
- apt-get update && apt-get install -y rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
- make --quiet -C tools do_limine
- make --quiet -C Drivers prepare
- make --quiet -C Userspace prepare
- make --quiet -C Lynx prepare
- make --quiet -C Kernel prepare
- sed -i 's/.*OSARCH = .*/OSARCH = amd64/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- make build
- mv Fennix.iso Fennix-debug.iso
- make clean
- sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
- make build
- mv Fennix.iso Fennix-release.iso
artifacts:
paths:
- Fennix-debug.iso
- Fennix-release.iso
build32:
stage: build-os
dependencies:
- compiler
- gnuefi
script:
- apt-get update && apt-get install -y rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
- make --quiet -C tools do_limine
- make --quiet -C Drivers prepare
- make --quiet -C Userspace prepare
- make --quiet -C Lynx prepare
- make --quiet -C Kernel prepare
- sed -i 's/.*OSARCH = .*/OSARCH = i386/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- make build
- mv Fennix.iso Fennix-debug.iso
- make clean
- sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
- make build
- mv Fennix.iso Fennix-release.iso
artifacts:
paths:
- Fennix-debug.iso
- Fennix-release.iso
buildarm64:
stage: build-os
dependencies:
- compiler
script:
- apt-get update && apt-get install -y rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
- make --quiet -C tools do_limine
- make --quiet -C Drivers prepare
- make --quiet -C Userspace prepare
- make --quiet -C Lynx prepare
- make --quiet -C Kernel prepare
- sed -i 's/.*OSARCH = .*/OSARCH = arm64/' ./Makefile.conf && cat Makefile.conf | grep OSARCH
- make build
- mv Fennix.iso Fennix-debug.iso
- make clean
- sed -i 's/.*DEBUG = .*/DEBUG = 0/' ./Makefile.conf && cat Makefile.conf | grep DEBUG
- make build
- mv Fennix.iso Fennix-release.iso
artifacts:
paths:
- Fennix-debug.iso
- Fennix-release.iso

12
.gitmodules vendored Normal file
View File

@ -0,0 +1,12 @@
[submodule "Kernel"]
path = Kernel
url = https://github.com/Fennix-Project/Kernel.git
[submodule "Lynx"]
path = Lynx
url = https://github.com/Fennix-Project/Lynx.git
[submodule "Userspace"]
path = Userspace
url = https://github.com/Fennix-Project/Userspace.git
[submodule "Modules"]
path = Drivers
url = https://github.com/Fennix-Project/Drivers.git

20
.vscode/c_boilerplates.code-snippets vendored Normal file
View File

@ -0,0 +1,20 @@
{
"Fennix Kernel Header": {
"scope": "c",
"prefix": [
"head",
],
"body": [
"#ifndef __FENNIX_KERNEL_${2:header}_H__",
"#define __FENNIX_KERNEL_${2:header}_H__",
"",
"#include <types.h>",
"",
"$0",
"",
"#endif // !__FENNIX_KERNEL_${2:header}_H__",
""
],
"description": "Create kernel header."
}
}

13
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"configurations": [
{
"name": "Linux",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"C_Cpp.errorSquiggles": "Enabled",
"C_Cpp.autocompleteAddParentheses": true,
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.clang_format_style": "Visual Studio",
"C_Cpp.default.intelliSenseMode": "gcc-x64",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.intelliSenseMemoryLimit": 16384,
"editor.smoothScrolling": true,
"editor.cursorSmoothCaretAnimation": "on",
"files.watcherExclude": {
"**/tools/binutils-gdb/**": true,
"**/tools/build-binutilsamd64/**": true,
"**/tools/build-binutilsarm64/**": true,
"**/tools/build-binutilsi386/**": true,
"**/tools/build-gccamd64/**": true,
"**/tools/build-gccarm64/**": true,
"**/tools/build-gcci386/**": true,
"**/tools/cross/**": true,
"**/tools/gcc/**": true,
"**/tools/limine/**": true,
"**/tools/qemu/**": true,
"**/doxygen-doc/**": true,
}
}

2659
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

1
Drivers Submodule

@ -0,0 +1 @@
Subproject commit 60391c032a7e37db0adf0365b75cb5ca1fb683b8

View File

@ -0,0 +1,112 @@
{
"folders": [
{
"path": "./Drivers"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"cSpell.words": [
"ABAR",
"ABSPOINTER",
"AHCI",
"BIST",
"Cardbus",
"CFIEN",
"cmdret",
"cmpb",
"driverinfo",
"ECTRL",
"EEPROM",
"Fennix",
"GETVERSION",
"HBAPRDT",
"IFCS",
"inportb",
"inportl",
"inportw",
"INTX",
"KAPI",
"LEDS",
"LPBK",
"LSTA",
"mminb",
"mminl",
"mminq",
"mminw",
"mmioin",
"mmioout",
"mmoutb",
"mmoutl",
"mmoutw",
"NABM",
"NABMB",
"NABMBOFF",
"outportb",
"outportl",
"outportw",
"PCIBAR",
"PCMOUT",
"PCNET",
"PCTRL",
"PMCF",
"PORTHB",
"PRDT",
"Prefetchable",
"RCTL",
"RCTRL",
"RDMTS",
"RDTR",
"rpci",
"RSRPD",
"RTCL",
"RTLC",
"RTLIB",
"RTLIL",
"RTLIW",
"RTLOB",
"RTLOL",
"RTLOW",
"RXDCTL",
"RXDESCHEAD",
"RXDESCHI",
"RXDESCLEN",
"RXDESCLO",
"RXDESCTAIL",
"Sata",
"SATAPI",
"SECRC",
"SEMB",
"SWXOFF",
"tclo",
"TCTL",
"TCTRL",
"TFES",
"TIPG",
"TSAD",
"TSTA",
"TXDESCHEAD",
"TXDESCHI",
"TXDESCLEN",
"TXDESCLO",
"TXDESCTAIL",
"TYPEMATIC",
"ubit",
"Virtio",
"Wmissing"
],
"files.associations": {
"*.su": "tsv",
"driver.h": "c",
"base.h": "c",
"types.h": "c",
"syscall.h": "c",
"aip.h": "c",
"input.h": "c",
"errno.h": "c",
"io.h": "c",
"rtl8139.hpp": "c",
"net.h": "c"
}
}
}

View File

@ -0,0 +1,532 @@
{
"folders": [
{
"path": "./Kernel"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"files.associations": {
"*.su": "tsv",
"thread": "cpp",
"bitset": "cpp",
"initializer_list": "cpp",
"semaphore": "cpp",
"memory": "cpp",
"limits": "cpp",
"climits": "cpp",
"iterator": "cpp",
"ranges": "cpp",
"cassert": "cpp",
"concepts": "cpp",
"cctype": "cpp",
"tuple": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"coroutine": "cpp",
"static_vector": "cpp",
"string_view": "cpp",
"compare": "cpp",
"limine.h": "c",
"types.h": "c",
"binfo.h": "c",
"liballoc_1_1.h": "c",
"cstring": "cpp",
"cargs.h": "c",
"memory.hpp": "c",
"convert.h": "c",
"limits.h": "c",
"assert.h": "c",
"cwalk.h": "c",
"md5.h": "c",
"stdint.h": "c",
"debug.h": "c",
"ubsan.h": "c",
"kernel.h": "c",
"filesystem.hpp": "c",
"vector.hpp": "c",
"string.hpp": "c",
"nc.hpp": "c",
"vector": "c",
"task.hpp": "c",
"recovery.hpp": "c",
"symbols.hpp": "c",
"cstddef": "cpp",
"atomic.hpp": "c",
"atomic": "cpp",
"syscalls.h": "c",
"cmath": "cpp",
"typeinfo": "c",
"exception": "cpp",
"errno.h": "c",
"float.h": "c",
"mutex": "cpp",
"type_trails": "cpp",
"utility": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"stdio.h": "c",
"string": "cpp",
"list": "cpp",
"stdexcept": "cpp",
"unistd.h": "c",
"unordered_map": "cpp",
"sched.h": "c",
"mman.h": "c",
"string.h": "c",
"macro.hpp": "c",
"stddef.h": "c",
"cfloat": "c",
"type_traits": "cpp",
"stdlib.h": "c",
"new": "cpp",
"ostream": "cpp",
"iostream": "cpp",
"istream": "cpp",
"ios": "cpp",
"locale": "cpp",
"unwind.h": "c",
"memory.h": "c",
"physical.hpp": "c",
"swap_pt.hpp": "c",
"brk.hpp": "c",
"bitmap.hpp": "c",
"lock.hpp": "c",
"virtual.hpp": "c",
"table.hpp": "c",
"vma.hpp": "c",
"abi.h": "c",
"kstack.hpp": "c",
"stack.hpp": "c",
"optional": "cpp"
},
"cSpell.words": [
"AABBCC",
"AAFF",
"AAFFAA",
"ABAR",
"ABIVERSION",
"ABSPOINTER",
"ACPI",
"ACPINVS",
"addralign",
"AEFF",
"AFAFAF",
"AHBA",
"AHCI",
"ALTLBA",
"APERF",
"apic",
"APICID",
"archaux",
"AROS",
"ARRAYSZ",
"auxv",
"BABABA",
"BADRAM",
"BGRT",
"bimi",
"binfo",
"biosdev",
"BIST",
"BITALG",
"BLOCKDEV",
"BLOCKDEVICE",
"BNDCFGS",
"bochs",
"bootanim",
"bootdev",
"Bootloader",
"brontobyte",
"CACACA",
"calloc",
"Cardbus",
"CCCCCCCPU",
"CHARDEV",
"CHARDEVICE",
"charsize",
"clac",
"CLOUDABI",
"CMCI",
"CMOS",
"cntvct",
"COMNULL",
"copydoc",
"cpudata",
"CPUID",
"crashdata",
"CSTAR",
"CTLS",
"cutlim",
"DADADA",
"daif",
"daifclr",
"daifset",
"DAPI",
"DBGP",
"DEBUGCTL",
"defragment",
"dfdesc",
"dialup",
"Didx",
"DLAB",
"Drivermemcpy",
"Drivermemset",
"Driversprintf",
"drvdir",
"DRVER",
"DSDT",
"DUID",
"dynstr",
"dynsym",
"EBDA",
"edid",
"EEPROM",
"EFER",
"Ehdr",
"ehsize",
"EISA",
"ELFABI",
"ELFCLASS",
"ELFDATA",
"ELFMAG",
"ELFOSABI",
"EMMINTRIN",
"endregion",
"Ensoniq",
"EVTSEL",
"EXECFN",
"exobyte",
"EXTD",
"FADT",
"FAFAFA",
"FAFAFAI",
"Fargc",
"Fargv",
"fcreat",
"fctprintf",
"Femto",
"FENIXOS",
"FENNIX",
"FFAA",
"FFAAAA",
"FFSMBIOS",
"FFXSR",
"filestatus",
"FMAPS",
"fonthdr",
"Framebuffer",
"FSGSBASE",
"fsmi",
"fxrstor",
"fxsave",
"Gamepad",
"Gameport",
"geopbyte",
"GETVERSION",
"GFNI",
"haddpd",
"headersize",
"HIPROC",
"HPET",
"hwaddress",
"ICRHI",
"ICRLO",
"IDIV",
"idtd",
"IFHLNK",
"infloop",
"inportb",
"inportl",
"inportw",
"INTFASTX",
"INTLEASTX",
"INTX",
"invlpg",
"ioapic",
"ioapicirq",
"IOCTLFS",
"IPCID",
"IRET",
"iretq",
"isdelim",
"ishld",
"ishst",
"itimerspec",
"itrfb",
"JMPREL",
"KAPI",
"KAPIPCI",
"kcalloc",
"kcon",
"kdentry",
"kdirent",
"kernelctl",
"kfree",
"klog",
"kmalloc",
"kproc",
"krealloc",
"kthrd",
"lapic",
"lfanew",
"LFLR",
"lgdt",
"liballoc",
"LIBLIST",
"lidt",
"limine",
"LMSLE",
"LOPROC",
"lsacpi",
"LSTAR",
"MADT",
"MADTIO",
"malloc",
"MCFG",
"memdbg",
"memmap",
"memsz",
"MEMTEST",
"mfence",
"MIDR",
"mminb",
"mminl",
"mminq",
"mminw",
"mmioin",
"mmioout",
"mmoutb",
"mmoutl",
"mmoutq",
"mmoutw",
"modbg",
"Modulememcpy",
"Modulememset",
"Modulesprintf",
"movaps",
"movddup",
"movdqa",
"movdqu",
"movntdq",
"movntdqa",
"movw",
"MPERF",
"MSRID",
"MTRR",
"MTRRCAP",
"multiboot",
"MWAIT",
"newfstatat",
"NIDENT",
"NOBITS",
"nullfd",
"nullptr",
"objptr",
"OEMID",
"Ofast",
"okstat",
"oldfd",
"OPENVOS",
"OPTMZ",
"OSABI",
"OSFXSR",
"OSXMMEXCPT",
"OSXSAVE",
"Outof",
"outportb",
"outportl",
"outportw",
"PAGESZ",
"palignr",
"PCIDE",
"pcmpistri",
"PCNET",
"PDBR",
"PDPTE",
"PEBS",
"PERFEVTSEL",
"PEXIT",
"PFLA",
"Phdrs",
"pheader",
"PHENT",
"phentsize",
"phnum",
"phoff",
"PHYSBASE",
"PHYSMASK",
"Pico",
"PINBASED",
"Pipefd",
"PKRU",
"PLTGOT",
"PLTREL",
"PLTRELSZ",
"POPCNT",
"PORTHB",
"powerline",
"Prefetchable",
"PREINIT",
"PROCBASED",
"PROGBITS",
"PTMX",
"ptys",
"pushfl",
"pushfq",
"Raphson",
"RARP",
"RBSTART",
"rdmsr",
"RDRAND",
"rdseed",
"rdtsc",
"readcr",
"readxcr",
"realloc",
"Realtek",
"RELAENT",
"RELASZ",
"RELSZ",
"Rodata",
"RPCI",
"rpmalloc",
"RRGGBB",
"RSDP",
"RSDT",
"RTIT",
"SATA",
"schedbg",
"SERCOS",
"serialports",
"sfence",
"sgdt",
"SGXLEPUBKEYHASH",
"Shdr",
"Sheader",
"shentsize",
"shnum",
"shoff",
"showbuf",
"shstrndx",
"shstrtab",
"sidt",
"SIGCOMP",
"sigsetsize",
"SIVR",
"SMAP",
"SMBASE",
"SMBIOSBIOS",
"SMEP",
"SMRR",
"SMXE",
"SNTP",
"SRAT",
"SSDT",
"sspt",
"SSSE",
"stac",
"strdbg",
"STRSZ",
"SVME",
"swapgs",
"Symbios",
"SYMENT",
"SYSENTER",
"sysret",
"sysretq",
"Tamsyn",
"targp",
"TCCR",
"TCLO",
"TCPA",
"TDCR",
"TEXIT",
"TEXTREL",
"Thrd",
"TICR",
"tlbi",
"Touchpad",
"tracepagetable",
"tskdbg",
"ttbr",
"uarch",
"uartmemdmp",
"ubsan",
"UINTFASTX",
"UINTLEASTX",
"UINTX",
"ultoa",
"UMIP",
"UMWAIT",
"UNMAP",
"Unmaskable",
"Unreserving",
"unseek",
"Unswap",
"unsynchronized",
"UPDT",
"UPID",
"uroot",
"UTID",
"VAES",
"VBMI",
"vectorize",
"vfctprintf",
"vfsdbg",
"Vidx",
"Virtio",
"VMCS",
"VMFUNC",
"vmouse",
"VMXE",
"VNNI",
"VNNIW",
"VPCLMULQDQ",
"VPID",
"VPOKE",
"VPOPCNTDQ",
"WAET",
"weakrefalias",
"Wignored",
"Wmissing",
"writecr",
"writexcr",
"wrmsr",
"WWVB",
"WWVH",
"Xalloc",
"xallocv",
"Xclac",
"xgetbv",
"Xmemcpy",
"Xmemset",
"XSDT",
"Xsize",
"XSLC",
"XSLF",
"XSLM",
"XSLR",
"Xstac",
"Xuintptr",
"yottabyte",
"zettabyte"
],
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"editor.quickSuggestionsDelay": 100,
"zenMode.hideLineNumbers": false,
"zenMode.hideActivityBar": false,
"zenMode.hideStatusBar": true,
"zenMode.centerLayout": true,
"zenMode.fullScreen": true,
"zenMode.restore": true,
"zenMode.silentNotifications": true,
"window.commandCenter": false,
"window.density.editorTabHeight": "default",
"editor.cursorBlinking": "blink",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorStyle": "line",
"editor.cursorWidth": 2
}
}

View File

@ -0,0 +1,22 @@
{
"folders": [
{
"path": "./Lynx"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"files.associations": {
"*.su": "tsv",
"limine.h": "c"
},
"cSpell.words": [
"Bootloader",
"COMNULL",
"CPUID",
"FENNIX",
"JMPREL",
"UBSAN"
]
}
}

View File

@ -0,0 +1,71 @@
{
"folders": [
{
"path": "./Userspace"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"files.associations": {
"*.su": "tsv",
"thread": "cpp",
"bitset": "cpp",
"initializer_list": "cpp",
"fex.hpp": "c",
"types.h": "c",
"dlfcn.h": "c",
"aux.h": "c",
"stddef.h": "c",
"stdio.h": "c",
"syscalls.h": "c",
"syslib.h": "c",
"sysfile.h": "c",
"ipc.h": "c",
"sysbase.h": "c",
"inttypes.h": "c",
"doomkeys.h": "c",
"doomgeneric.h": "c",
"elf.h": "c",
"init.h": "c",
"unused_code": "cpp",
"liballoc_1_1.h": "c",
"errno.h": "c",
"stdlib.h": "c",
"stdarg.h": "c",
"printf.h": "c",
"ctype.h": "c",
"unistd.h": "c",
"stat.h": "c",
"wait.h": "c",
"base.h": "c",
"ld.h": "c",
"syscall.h": "c",
"stdint.h": "c",
"setjmp.h": "c",
"limits.h": "c",
"fcntl.h": "c",
"pty.h": "c",
"string.h": "c",
"time.h": "c",
"reboot.h": "c",
"*.in": "c",
"signal.h": "c",
"alltypes.h": "c",
"pr44328.C": "cpp"
},
"cSpell.words": [
"auxv",
"cmpq",
"FENNIX",
"JMPREL",
"Krnl",
"liballoc",
"libinit",
"oldpath",
"preinit",
"Shdr",
"vfctprintf",
"WAITSTATUS"
]
}
}

35
Fennix.code-workspace Normal file
View File

@ -0,0 +1,35 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"files.associations": {
"*.su": "tsv",
"thread": "cpp",
"bitset": "cpp",
"initializer_list": "cpp",
"semaphore": "cpp",
"memory": "cpp",
"limits": "cpp",
"climits": "cpp",
"iterator": "cpp",
"ranges": "cpp",
"cassert": "cpp",
"concepts": "cpp",
"cctype": "cpp",
"tuple": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"coroutine": "cpp",
"static_vector": "cpp",
"string_view": "cpp",
"compare": "cpp",
"ostream": "cpp",
"unordered_map": "cpp",
"vector": "cpp"
}
}
}

1
Kernel Submodule

@ -0,0 +1 @@
Subproject commit 19f2a78d357f48ec2c2cf2bd46ac35408b3965ec

29
LICENSE Normal file
View File

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2022, EnderIce2
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

1
Lynx Submodule

@ -0,0 +1 @@
Subproject commit 9365295da732292f600b37738120124c297f1346

13
Lynx.code-workspace Normal file
View File

@ -0,0 +1,13 @@
{
"folders": [
{
"path": "./Lynx"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true,
"files.associations": {
"efi.h": "c"
}
}
}

238
Makefile Normal file
View File

@ -0,0 +1,238 @@
include Makefile.conf
.PHONY: default tools clean
# First rule
default:
$(error Please specify a target)
# For tap0
# -netdev tap,id=usernet0,ifname=tap0,script=no,downscript=no
QEMU = ./$(QEMU_PATH)$(QEMU_ARCH)
QEMUFLAGS := -display gtk
ifeq ($(OSARCH), amd64)
QEMUFLAGS += -device vmware-svga -M q35 \
-usb \
-device qemu-xhci,id=xhci \
-device usb-mouse,bus=xhci.0,pcap=mousex.pcap \
-device usb-kbd,bus=xhci.0,pcap=kbdx.pcap \
-device usb-mouse,pcap=mouse.pcap \
-device usb-kbd,pcap=kbd.pcap \
-net user \
-netdev user,id=usernet0 \
-device e1000,netdev=usernet0,mac=00:69:96:00:42:00 \
-object filter-dump,id=usernet0,netdev=usernet0,file=network.dmp,maxlen=1024 \
-serial file:serial.log \
-serial file:profiler.log \
-serial file:serial3.dmp \
-serial stdio \
-parallel file:parallel.log \
-device ahci,id=ahci \
-drive id=bootdsk,file=$(OSNAME).iso,format=raw,if=none \
-device ide-hd,drive=bootdsk,bus=ahci.0 \
-drive id=disk,file=qemu-disk.qcow2,if=none \
-device ide-hd,drive=disk,bus=ahci.1 \
-audiodev pa,id=pa1,server=/run/user/1000/pulse/native \
-machine pcspk-audiodev=pa1 \
-device AC97,audiodev=pa1 \
-device intel-hda \
-device ich9-intel-hda \
-acpitable file=tools/SSDT1.dat
else ifeq ($(OSARCH), i386)
QEMUFLAGS += -M q35 \
-usb \
-device qemu-xhci,id=xhci \
-device usb-mouse,bus=xhci.0,pcap=mousex.pcap \
-device usb-kbd,bus=xhci.0,pcap=kbdx.pcap \
-device usb-mouse,pcap=mouse.pcap \
-device usb-kbd,pcap=kbd.pcap \
-net user \
-netdev user,id=usernet0 \
-device e1000,netdev=usernet0,mac=00:69:96:00:42:00 \
-object filter-dump,id=usernet0,netdev=usernet0,file=network.dmp,maxlen=1024 \
-serial file:serial.log \
-serial file:profiler.log \
-serial file:serial3.dmp \
-serial stdio \
-parallel file:parallel.log \
-hda $(OSNAME).iso \
-audiodev pa,id=pa1,server=/run/user/1000/pulse/native \
-machine pcspk-audiodev=pa1 \
-device AC97,audiodev=pa1 \
-device intel-hda \
-device ich9-intel-hda \
-acpitable file=tools/SSDT1.dat
else ifeq ($(OSARCH), aarch64)
QEMUFLAGS += -M raspi3b \
-cpu cortex-a57 \
-serial file:serial.log \
-serial file:profiler.log \
-serial file:serial3.dmp \
-serial stdio \
-kernel $(OSNAME).img \
-acpitable file=tools/SSDT1.dat
endif
doxygen:
mkdir -p doxygen-doc
doxygen Doxyfile
doxygen Kernel/Doxyfile
doxygen Lynx/Doxyfile
doxygen Userspace/Doxyfile
doxygen Drivers/Doxyfile
qemu_vdisk:
ifneq (,$(wildcard ./qemu-disk.qcow2))
$(info qemu-disk.qcow2 Already exists)
else
qemu-img create -f qcow2 qemu-disk.qcow2 1G
endif
# Install necessary packages, build cross-compiler etc...
tools:
make --quiet -C tools all
make --quiet -C Kernel prepare
make --quiet -C Lynx prepare
make --quiet -C Userspace prepare
make --quiet -C Drivers prepare
build: build_lynx build_kernel build_userspace build_drivers build_image
dump:
make --quiet -C Kernel dump
rebuild: clean build
ifeq ($(QUIET_BUILD), 1)
MAKE_QUIET_FLAG = --quiet
endif
build_lynx:
ifeq ($(BOOTLOADER), lynx)
make $(MAKE_QUIET_FLAG) -C Lynx build
endif
build_kernel:
ifeq ($(BUILD_KERNEL), 1)
make -j$(shell nproc) $(MAKE_QUIET_FLAG) -C Kernel build
endif
build_userspace:
ifeq ($(BUILD_USERSPACE), 1)
make $(MAKE_QUIET_FLAG) -C Userspace build
endif
build_drivers:
ifeq ($(BUILD_DRIVERS), 1)
make $(MAKE_QUIET_FLAG) -C Drivers build
endif
build_image:
mkdir -p iso_tmp_data
mkdir -p initrd_tmp_data
cp -r initrd/* initrd_tmp_data/
ifeq ($(BUILD_DRIVERS), 1)
cp -r Drivers/out/* initrd_tmp_data/usr/lib/drivers/
endif
ifeq ($(BUILD_USERSPACE), 1)
cp -r Userspace/out/* initrd_tmp_data/
endif
# tar czf initrd.tar -C initrd_tmp_data/ ./ --format=ustar
tar cf initrd.tar -C initrd_tmp_data/ ./ --format=ustar
cp Kernel/fennix.elf initrd.tar \
iso_tmp_data/
ifeq ($(BOOTLOADER), lynx)
cp tools/lynx.cfg Lynx/loader.bin Lynx/efi-loader.bin iso_tmp_data/
xorriso -as mkisofs -b loader.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot efi-loader.bin -V FENNIX \
-efi-boot-part --efi-boot-image --protective-msdos-label \
iso_tmp_data -o $(OSNAME).iso
endif
ifeq ($(BOOTLOADER), limine)
cp tools/limine.cfg $(LIMINE_FOLDER)/limine-bios.sys \
$(LIMINE_FOLDER)/limine-bios-cd.bin \
$(LIMINE_FOLDER)/limine-uefi-cd.bin \
iso_tmp_data/
mkdir -p iso_tmp_data/EFI/BOOT
cp $(LIMINE_FOLDER)/BOOTX64.EFI \
$(LIMINE_FOLDER)/BOOTIA32.EFI \
iso_tmp_data/EFI/BOOT/
xorriso -as mkisofs -quiet -b limine-bios-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-uefi-cd.bin -V FENNIX \
-efi-boot-part --efi-boot-image --protective-msdos-label \
iso_tmp_data -o $(OSNAME).iso
endif
ifeq ($(BOOTLOADER), grub)
# TODO: Add custom language support for GRUB or detect the system language using "echo $LANG | cut -d . -f 1" and set "lang" variable inside grub.cfg
mkdir -p iso_tmp_data/boot
mkdir -p iso_tmp_data/boot/grub
cp tools/grub.cfg iso_tmp_data/boot/grub/
grub-mkrescue -o $(OSNAME).iso iso_tmp_data
endif
ifeq ($(OSARCH), aarch64)
$(COMPILER_PATH)/$(COMPILER_ARCH)objcopy Kernel/fennix.elf -O binary $(OSNAME).img
endif
ifeq ($(OSARCH), amd64)
QEMU_UEFI_BIOS = -bios /usr/share/qemu/OVMF.fd
endif
# ifeq ($(OSARCH), aarch64)
# QEMU_UEFI_BIOS = -bios -bios /usr/share/AAVMF/AAVMF_CODE.fd
# endif
ifeq ($(OSARCH), amd64)
QEMU_SMP_DBG = -smp $(shell echo $(shell nproc)/4 | bc)
QEMU_SMP = -smp $(shell nproc)
endif
ifeq ($(OSARCH), i386)
QEMU_SMP_DBG = -smp $(shell echo $(shell nproc)/4 | bc)
QEMU_SMP = -smp $(shell nproc)
endif
ifeq ($(OSARCH), aarch64)
QEMU_SMP_DBG = -smp 4
QEMU_SMP = -smp 4
endif
ifeq ($(OSARCH), amd64)
QEMUHWACCELERATION = -machine q35 -enable-kvm
QEMUMEMORY = -m 4G
else ifeq ($(OSARCH), i386)
QEMUHWACCELERATION = -machine q35 -enable-kvm
QEMUMEMORY = -m 4G
else ifeq ($(OSARCH), aarch64)
QEMUHWACCELERATION =
QEMUMEMORY = -m 1G
endif
clean_logs:
rm -f serial.log profiler.log serial3.dmp network.dmp parallel.log mouse.pcap kbd.pcap mousex.pcap kbdx.pcap
vscode_debug_only: clean_logs
$(QEMU) -S -gdb tcp::1234 -d cpu_reset,int -no-reboot -no-shutdown $(QEMU_UEFI_BIOS) -m 512M $(QEMUFLAGS) $(QEMU_SMP_DBG)
vscode_debug: build_lynx build_kernel build_userspace build_drivers build_image vscode_debug_only
qemu: qemu_vdisk clean_logs
touch serial.log parallel.log
# x-terminal-emulator -e tail -f serial.log &
# x-terminal-emulator -e tail -f parallel.log &
$(QEMU) $(QEMU_UEFI_BIOS) -cpu host $(QEMUFLAGS) $(QEMUHWACCELERATION) $(QEMUMEMORY) $(QEMU_SMP)
qemubios: qemu_vdisk clean_logs
$(QEMU) -cpu host $(QEMUFLAGS) $(QEMUHWACCELERATION) $(QEMUMEMORY) $(QEMU_SMP)
run: build qemu
clean: clean_logs
rm -rf doxygen-doc iso_tmp_data initrd_tmp_data
rm -f initrd.tar $(OSNAME).iso $(OSNAME).img
make -C Kernel clean
make -C Lynx clean
make -C Userspace clean
make -C Drivers clean

70
Makefile.conf Normal file
View File

@ -0,0 +1,70 @@
# If the OS we are building should be compiled
# for debugging purposes.
DEBUG = 1
# Operating system name.
OSNAME = Fennix
# OS architecture: amd64, i386, aarch64
OSARCH = amd64
# Kernel version.
KERNEL_VERSION = dev
# Which bootloader to use.
# Available bootloaders:
# - lynx - Lynx (under development)
# - grub - GRUB
# - limine - Limine
BOOTLOADER = grub
BUILD_KERNEL = 1
BUILD_USERSPACE = 1
BUILD_DRIVERS = 1
QUIET_BUILD = 1
# The path of the cross-compiler.
COMPILER_PATH = tools/cross/bin
# The path of the Limine bootloader.
LIMINE_FOLDER = tools/limine
# Qemu path. If you want to use the one
# you have installed in your system, change
# it to /usr/bin/qemu-system-
# (do not include x86_64 or i386, it will be
# added automatically depending on the OSARCH)
QEMU_PATH = tools/cross/bin/qemu-system-
# Set libc to use. Available options:
# - internal - Use the internal libc
# - musl - Use musl libc (linux syscalls)
USE_LIBC = musl
# Build all libraries as static libraries.
USERSPACE_STATIC_LIBS = 0
# Make related variables
# -----------------------
# Do not change anything below this line unless
# you know what you are doing.
ifeq ($(OSARCH), amd64)
COMPILER_ARCH = x86_64-fennix-
QEMU_ARCH = x86_64
else ifeq ($(OSARCH), i386)
COMPILER_ARCH = i386-fennix-
QEMU_ARCH = i386
else ifeq ($(OSARCH), aarch64)
COMPILER_ARCH = aarch64-fennix-
QEMU_ARCH = aarch64
endif

34
README.md Normal file
View File

@ -0,0 +1,34 @@
# Fennix
Opeating System from scratch made in C and C++
---
#### How to compile & run
- Clone repo using:
```bash
git clone --recurse-submodules https://github.com/Fennix-Project/Fennix.git
```
- Build the cross-compiler and other tools:
```bash
make tools
```
- Compile using:
```bash
make build
```
- Run using:
```bash
make run
```
- Clean using:
```bash
make clean
```
More info about compiling and running [here](https://fennix.enderice2.software/).

1
Userspace Submodule

@ -0,0 +1 @@
Subproject commit 961ddd0bd8dec37743395d2b7f8b896132e87b1d

0
initrd/bin/.gitkeep Normal file
View File

View File

@ -0,0 +1 @@
DefaultDevice=0

6
initrd/etc/cross/linux Normal file
View File

@ -0,0 +1,6 @@
[uname]
sysname=Linux
nodename=auto
release=3.2.0-10-generic
version=#10-Ubuntu SMP Mon Jav 1 00:00:00 UTC 0
machine=auto

1
initrd/etc/group Normal file
View File

@ -0,0 +1 @@
root:x:0:

26
initrd/etc/ntp Normal file
View File

@ -0,0 +1,26 @@
time.nist.gov
0.pool.ntp.org
1.pool.ntp.org
2.pool.ntp.org
3.pool.ntp.org
time-a-g.nist.gov
time-b-g.nist.gov
time-c-g.nist.gov
time-d-g.nist.gov
time-d-g.nist.gov
time-e-g.nist.gov
time-e-g.nist.gov
time-a-wwv.nist.gov
time-b-wwv.nist.gov
time-c-wwv.nist.gov
time-d-wwv.nist.gov
time-d-wwv.nist.gov
time-e-wwv.nist.gov
time-e-wwv.nist.gov
time-a-b.nist.gov
time-b-b.nist.gov
time-c-b.nist.gov
time-d-b.nist.gov
time-d-b.nist.gov
time-e-b.nist.gov
time-e-b.nist.gov

1
initrd/etc/passwd Normal file
View File

@ -0,0 +1 @@
root:x:0:0:root:/root:/bin/sh

66
initrd/etc/term Normal file
View File

@ -0,0 +1,66 @@
[general]
theme=vga
[cursor]
color=255,255,255
blink=true
[vga]
color0=0,0,0:133,133,133
color1=170,0,0:255,85,85
color2=0,170,0:85,255,85
color3=170,85,0:255,255,85
color4=0,0,170:85,85,255
color5=170,0,170:255,85,255
color6=0,170,170:85,255,255
color7=170,170,170:255,255,255
[breeze]
color0=35,38,39:127,140,141
color1=237,21,21:192,57,43
color2=17,209,22:28,220,154
color3=246,116,0:253,188,75
color4=29,153,243:61,174,233
color5=155,89,182:142,68,173
color6=26,188,156:22,160,133
color7=252,252,252:255,255,255
[coolbreeze]
color0=20,30,40:90,100,110
color1=180,40,40:150,30,30
color2=40,180,40:70,200,60
color3=180,120,40:220,170,60
color4=40,90,180:80,130,200
color5=150,60,150:120,40,140
color6=30,170,170:20,140,140
color7=210,210,210:190,190,190
[softlight]
color0=40,44,48:128,132,136
color1=210,50,50:180,80,80
color2=60,170,60:90,210,90
color3=180,150,30:220,200,80
color4=50,70,150:100,120,210
color5=180,90,180:170,70,170
color6=30,190,190:70,170,170
color7=220,220,220:240,240,240
[calmsea]
color0=30,40,50:110,120,130
color1=190,50,50:150,60,60
color2=50,190,50:80,200,80
color3=200,160,50:240,200,70
color4=50,100,200:90,140,220
color5=160,80,160:140,60,140
color6=40,180,180:30,140,140
color7=230,230,230:210,210,210
[warmember]
color0=40,30,20:120,100,80
color1=210,80,60:180,60,50
color2=70,200,60:100,220,70
color3=190,130,30:230,180,60
color4=60,120,200:100,140,230
color5=170,70,160:140,50,130
color6=40,200,200:30,170,170
color7=220,220,220:200,200,200

0
initrd/home/.gitkeep Normal file
View File

0
initrd/include/.gitkeep Normal file
View File

0
initrd/lib/.gitkeep Normal file
View File

0
initrd/root/.gitkeep Normal file
View File

1
initrd/tmp/invalid Symbolic link
View File

@ -0,0 +1 @@
/foo/bar

1
initrd/tmp/link Symbolic link
View File

@ -0,0 +1 @@
/tmp/test.txt

31
initrd/tmp/pangrams.txt Normal file
View File

@ -0,0 +1,31 @@
Code Language Pangram
ar Arabic صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطا
bs Bosnian Sva ljudska bića rađaju se slobodna i jednaka u dostojanstvu i pravima
cs Czech Příliš žluťoučký kůň úpěl ďábelské ódy
da Danish Høj bly gom vandt fræk sexquiz på wc
de German Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich
el Greek Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός Takhístè alôpèx vaphês psèménè gè, draskelízei ypér nòthroý kynós
es Spanish Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú
et Estonian Põdur Zagrebi tšellomängija-följetonist Ciqo külmetas kehvas garaažis
fi Finnish Fahrenheit ja Celsius yrjösivät Åsan backgammon-peliin, Volkswagenissa, daiquirin ja ZX81:n yhteisvaikutuksesta
fr French Buvez de ce whisky que le patron juge fameux
he Hebrew שפן אכל קצת גזר בטעם חסה, ודי לְדַפדֵף הפתרונות שלי עֶזרָה הֲגָנָה
hi Hindi लाभो सुचना उद्योग परिवहन विनिमय बाटते काम अधिकार निर्माता विभाजनक्षमता सादगि हुआआदी विश्वास वहहर
id Indonesian Muharjo seorang xenofobia universal yang takut pada warga jazirah, contohnya Qatar
it Italian Ma la volpe, col suo balzo, ha raggiunto il quieto Fido
ja Japanese いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす。
ko Korean 키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다
lt Lithuanian Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą
lv Latvian Muļķa hipiji mēģina brīvi nogaršot celofāna žņaudzējčūsku
nb Norwegian Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi
nl Dutch Exact vijf voor twaalf had de psycholoog zijn quotum bereikt
pl Polish Jeżu klątw, spłódź Finom część gry hańb!
pt Portuguese Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português
ro Romanian Vând muzică de jazz și haine de bun-gust în New-York și Quebec la preț fix
ru Russian В чащах юга жил бы цитрус? Да, но фальшивый экземпляръ!
sk Slovak Kŕdeľ šťastných ďatľov učí pri ústí Váhu mĺkveho koňa obhrýzať kôru a žrať čerstvé mäso
sv Swedish Yxskaftbud, ge vår WC-zonmö IQ-hjälp
th Thai เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร
tr Turkish Pijamalı hasta yağız şoföre çabucak güvendi
vi Vietnamese Do bạch kim rất quý, sẽ để lắp vô xương
zh Chinese 視野無限廣,窗外有藍天 (traditional) 中国智造,慧及全球 (simplified)

2
initrd/tmp/test.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
echo "Hello World!"

1
initrd/tmp/test.txt Normal file
View File

@ -0,0 +1 @@
Hello World!

0
initrd/usr/bin/.gitkeep Normal file
View File

View File

View File

View File

0
initrd/var/.gitkeep Normal file
View File

View File

2
tailprofiler.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
tail -f profiler.log

2
tailserial.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
tail -f serial.log

328
tools/ErrorParser.cpp Executable file
View File

@ -0,0 +1,328 @@
#include <iostream>
#include <cstdint>
using namespace std;
#define clear system("clear")
typedef union CR0
{
struct
{
/** @brief Protection Enable */
uint64_t PE : 1;
/** @brief Monitor Coprocessor */
uint64_t MP : 1;
/** @brief Emulation */
uint64_t EM : 1;
/** @brief Task Switched */
uint64_t TS : 1;
/** @brief Extension Type */
uint64_t ET : 1;
/** @brief Numeric Error */
uint64_t NE : 1;
/** @brief Reserved */
uint64_t _reserved0 : 10;
/** @brief Write Protect */
uint64_t WP : 1;
/** @brief Reserved */
uint64_t _reserved1 : 1;
/** @brief Alignment Mask */
uint64_t AM : 1;
/** @brief Reserved */
uint64_t _reserved2 : 10;
/** @brief Mot Write-through */
uint64_t NW : 1;
/** @brief Cache Disable */
uint64_t CD : 1;
/** @brief Paging */
uint64_t PG : 1;
};
uint64_t raw;
} CR0;
typedef union CR2
{
struct
{
/** @brief Page Fault Linear Address */
uint64_t PFLA;
};
uint64_t raw;
} CR2;
typedef union CR3
{
struct
{
/** @brief Not used if bit 17 of CR4 is 1 */
uint64_t PWT : 1;
/** @brief Not used if bit 17 of CR4 is 1 */
uint64_t PCD : 1;
/** @brief Base of PML4T/PML5T */
uint64_t PDBR;
};
uint64_t raw;
} CR3;
typedef union CR4
{
struct
{
/** @brief Virtual-8086 Mode Extensions */
uint64_t VME : 1;
/** @brief Protected-Mode Virtual Interrupts */
uint64_t PVI : 1;
/** @brief Time Stamp Disable */
uint64_t TSD : 1;
/** @brief Debugging Extensions */
uint64_t DE : 1;
/** @brief Page Size Extensions */
uint64_t PSE : 1;
/** @brief Physical Address Extension */
uint64_t PAE : 1;
/** @brief Machine Check Enable */
uint64_t MCE : 1;
/** @brief Page Global Enable */
uint64_t PGE : 1;
/** @brief Performance Monitoring Counter */
uint64_t PCE : 1;
/** @brief Operating System Support */
uint64_t OSFXSR : 1;
/** @brief Operating System Support */
uint64_t OSXMMEXCPT : 1;
/** @brief User-Mode Instruction Prevention */
uint64_t UMIP : 1;
/** @brief Linear Address 57bit */
uint64_t LA57 : 1;
/** @brief VMX Enable */
uint64_t VMXE : 1;
/** @brief SMX Enable */
uint64_t SMXE : 1;
/** @brief Reserved */
uint64_t _reserved0 : 1;
/** @brief FSGSBASE Enable */
uint64_t FSGSBASE : 1;
/** @brief PCID Enable */
uint64_t PCIDE : 1;
/** @brief XSAVE and Processor Extended States Enable */
uint64_t OSXSAVE : 1;
/** @brief Reserved */
uint64_t _reserved1 : 1;
/** @brief SMEP Enable */
uint64_t SMEP : 1;
/** @brief SMAP Enable */
uint64_t SMAP : 1;
/** @brief Protection-Key Enable */
uint64_t PKE : 1;
/** @brief Reserved */
uint64_t _reserved2 : 9;
};
uint64_t raw;
} CR4;
typedef union
{
struct
{
/** @brief Carry Flag */
uint64_t CF : 1;
/** @brief Reserved */
uint64_t always_one : 1;
/** @brief Parity Flag */
uint64_t PF : 1;
/** @brief Reserved */
uint64_t _reserved0 : 1;
/** @brief Auxiliary Carry Flag */
uint64_t AF : 1;
/** @brief Reserved */
uint64_t _reserved1 : 1;
/** @brief Zero Flag */
uint64_t ZF : 1;
/** @brief Sign Flag */
uint64_t SF : 1;
/** @brief Trap Flag */
uint64_t TF : 1;
/** @brief Interrupt Enable Flag */
uint64_t IF : 1;
/** @brief Direction Flag */
uint64_t DF : 1;
/** @brief Overflow Flag */
uint64_t OF : 1;
/** @brief I/O Privilege Level */
uint64_t IOPL : 2;
/** @brief Nested Task */
uint64_t NT : 1;
/** @brief Reserved */
uint64_t _reserved2 : 1;
/** @brief Resume Flag */
uint64_t RF : 1;
/** @brief Virtual 8086 Mode */
uint64_t VM : 1;
/** @brief Alignment Check */
uint64_t AC : 1;
/** @brief Virtual Interrupt Flag */
uint64_t VIF : 1;
/** @brief Virtual Interrupt Pending */
uint64_t VIP : 1;
/** @brief ID Flag */
uint64_t ID : 1;
/** @brief Reserved */
uint64_t _reserved3 : 10;
};
uint64_t raw;
} Rrfl;
typedef union PageFaultErrorCode
{
struct
{
uint64_t P : 1;
uint64_t W : 1;
uint64_t U : 1;
uint64_t R : 1;
uint64_t I : 1;
uint64_t PK : 1;
uint64_t SS : 1;
uint64_t Reserved0 : 8;
uint64_t SGX : 1;
uint64_t Reserved1 : 16;
};
uint64_t raw;
} PageFaultErrorCode;
static const char *pagefault_message[] = {
"Supervisory process tried to read a non-present page entry",
"Supervisory process tried to read a page and caused a protection fault",
"Supervisory process tried to write to a non-present page entry",
"Supervisory process tried to write a page and caused a protection fault",
"User process tried to read a non-present page entry",
"User process tried to read a page and caused a protection fault",
"User process tried to write to a non-present page entry",
"User process tried to write a page and caused a protection fault"};
// TODO: This code can be improved.
int main(char argc, char *argv[])
{
clear;
char crtype = 0;
cout << "Enter error type [CR-0,2,3,4,f; Error-e; Help-h]: ";
cin >> crtype;
clear;
CR0 cr0;
CR2 cr2;
CR3 cr3;
CR4 cr4;
Rrfl rfl;
if (crtype == '0' || crtype == '2' || crtype == '3' || crtype == '4' || crtype == 'f')
{
cout << "Enter CR data: ";
uint64_t raw;
cin >> hex >> raw;
cr0.raw = raw;
cr2.raw = raw;
cr3.raw = raw;
cr4.raw = raw;
rfl.raw = raw;
clear;
}
switch (crtype)
{
case '0':
printf("CR0: PE:%s MP:%s EM:%s TS:%s\n ET:%s NE:%s WP:%s AM:%s\n NW:%s CD:%s PG:%s\n R0:%#x R1:%#x R2:%#x\n",
cr0.PE ? "True " : "False", cr0.MP ? "True " : "False", cr0.EM ? "True " : "False", cr0.TS ? "True " : "False",
cr0.ET ? "True " : "False", cr0.NE ? "True " : "False", cr0.WP ? "True " : "False", cr0.AM ? "True " : "False",
cr0.NW ? "True " : "False", cr0.CD ? "True " : "False", cr0.PG ? "True " : "False",
cr0._reserved0, cr0._reserved1, cr0._reserved2);
break;
case '2':
{
printf("CR2: PFLA: %#lx\n",
cr2.PFLA);
break;
}
break;
case '3':
printf("CR3: PWT:%s PCD:%s PDBR:%#lx\n",
cr3.PWT ? "True " : "False", cr3.PCD ? "True " : "False", cr3.PDBR);
break;
case '4':
printf("CR4: VME:%s PVI:%s TSD:%s DE:%s\n PSE:%s PAE:%s MCE:%s PGE:%s\n PCE:%s UMIP:%s OSFXSR:%s OSXMMEXCPT:%s\n LA57:%s VMXE:%s SMXE:%s PCIDE:%s\n OSXSAVE:%s SMEP:%s SMAP:%s PKE:%s\n R0:%#x R1:%#x R2:%#x\n",
cr4.VME ? "True " : "False", cr4.PVI ? "True " : "False", cr4.TSD ? "True " : "False", cr4.DE ? "True " : "False",
cr4.PSE ? "True " : "False", cr4.PAE ? "True " : "False", cr4.MCE ? "True " : "False", cr4.PGE ? "True " : "False",
cr4.PCE ? "True " : "False", cr4.UMIP ? "True " : "False", cr4.OSFXSR ? "True " : "False", cr4.OSXMMEXCPT ? "True " : "False",
cr4.LA57 ? "True " : "False", cr4.VMXE ? "True " : "False", cr4.SMXE ? "True " : "False", cr4.PCIDE ? "True " : "False",
cr4.OSXSAVE ? "True " : "False", cr4.SMEP ? "True " : "False", cr4.SMAP ? "True " : "False", cr4.PKE ? "True " : "False",
cr4._reserved0, cr4._reserved1, cr4._reserved2);
break;
case 'f':
printf("RFL: CF:%s PF:%s AF:%s ZF:%s\n SF:%s TF:%s IF:%s DF:%s\n OF:%s IOPL:%s NT:%s RF:%s\n VM:%s AC:%s VIF:%s VIP:%s\n ID:%s AlwaysOne:%d\n R0:%#x R1:%#x R2:%#x R3:%#x\n",
rfl.CF ? "True " : "False", rfl.PF ? "True " : "False", rfl.AF ? "True " : "False", rfl.ZF ? "True " : "False",
rfl.SF ? "True " : "False", rfl.TF ? "True " : "False", rfl.IF ? "True " : "False", rfl.DF ? "True " : "False",
rfl.OF ? "True " : "False", rfl.IOPL ? "True " : "False", rfl.NT ? "True " : "False", rfl.RF ? "True " : "False",
rfl.VM ? "True " : "False", rfl.AC ? "True " : "False", rfl.VIF ? "True " : "False", rfl.VIP ? "True " : "False",
rfl.ID ? "True " : "False", rfl.always_one,
rfl._reserved0, rfl._reserved1, rfl._reserved2, rfl._reserved3);
break;
case 'e':
{
// TODO: support more error types
uint32_t err_code = 0;
cout << "[0xe Page Fault] e=";
cin >> err_code;
clear;
printf("Page Fault e=%04d\n", err_code);
PageFaultErrorCode params = {.raw = (uint32_t)err_code};
printf("Page: %s\n", params.P ? "Present" : "Not Present");
cout << "\033[1;31m When set, the page fault was caused by a page-protection violation. When not set, it was caused by a non-present page.\033[0m\n\n";
printf("Write Operation: %s\n", params.W ? "Read-Only" : "Read-Write");
cout << "\033[1;31m When set, the page fault was caused by a write access. When not set, it was caused by a read access.\033[0m\n\n";
printf("Processor Mode: %s\n", params.U ? "User-Mode" : "Kernel-Mode");
cout << "\033[1;31m When set, the page fault was caused while CPL = 3. This does not necessarily mean that the page fault was a privilege violation.\033[0m\n\n";
printf("CPU Reserved Bits: %s\n", params.R ? "Reserved" : "Unreserved");
cout << "\033[1;31m When set, one or more page directory entries contain reserved bits which are set to 1. This only applies when the PSE or PAE rfl in CR4 are set to 1.\033[0m\n\n";
printf("Caused By An Instruction Fetch: %s\n", params.I ? "Yes" : "No");
cout << "\033[1;31m When set, the page fault was caused by an instruction fetch. This only applies when the No-Execute bit is supported and enabled.\033[0m\n\n";
printf("Caused By A Protection-Key Violation: %s\n", params.PK ? "Yes" : "No");
cout << "\033[1;31m When set, the page fault was caused by a protection-key violation. The PKRU register (for user-mode accesses) or PKRS MSR (for supervisor-mode accesses) specifies the protection key rights.\033[0m\n\n";
printf("Caused By A Shadow Stack Access: %s\n", params.SS ? "Yes" : "No");
cout << "\033[1;31m When set, the page fault was caused by a shadow stack access.\033[0m\n\n";
printf("Caused By An SGX Violation: %s\n", params.SGX ? "Yes" : "No");
cout << "\033[1;31m When set, the fault was due to an SGX violation. The fault is unrelated to ordinary paging.\033[0m\n\n";
printf("Description: %s\n", err_code & 0x00000008 ? "One or more page directory entries contain reserved bits which are set to 1." : pagefault_message[err_code & 0b111]);
cout << "\033[1;31m Detailed exception\033[0m\n\n";
printf("Reserved0: %#lx\n", params.Reserved0);
cout << "\033[1;31m Reserved\033[0m\n\n";
printf("Reserved1: %#lx\n", params.Reserved1);
cout << "\033[1;31m Reserved\033[0m\n\n";
break;
}
case 'h':
{
cout << "Make qemu error code (e=????) or control registers easy to read." << endl;
cout << "----------------------------------------------------------------" << endl;
cout << "0,2,3,4 - CR data" << endl;
cout << "e - Error code from QEMU" << endl;
cout << "h - This text" << endl;
break;
}
default:
cout << "Invalid error type" << endl;
break;
}
return 0;
}

147
tools/Fex.c Normal file
View File

@ -0,0 +1,147 @@
// FEX is a file format. Right now in development.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "../Kernel/Fex.hpp"
void DumpData(const char *Description, unsigned char *Address, unsigned long Length)
{
printf("-------------------------------------------------------------------------\n");
unsigned char Buffer[17];
unsigned long Iterate;
if (Description != NULL)
printf("%s:\n", Description);
for (Iterate = 0; Iterate < Length; Iterate++)
{
if ((Iterate % 16) == 0)
{
if (Iterate != 0)
printf(" %s\n", Buffer);
printf(" %04x ", Iterate);
}
printf(" %02x", Address[Iterate]);
if ((Address[Iterate] < 0x20) || (Address[Iterate] > 0x7e))
Buffer[Iterate % 16] = '.';
else
Buffer[Iterate % 16] = Address[Iterate];
Buffer[(Iterate % 16) + 1] = '\0';
}
while ((Iterate % 16) != 0)
{
printf(" ");
Iterate++;
}
printf(" %s\n", Buffer);
printf("-------------------------------------------------------------------------\n");
}
int main()
{
FILE *FilePointer;
char FileName[20];
unsigned char *Buffer;
char BufferChar;
struct stat st;
printf("--- FEX file viewer ---\n");
FileSelection:
printf("File Name: ");
fgets(FileName, 20, stdin);
FileName[strcspn(FileName, "\r\n")] = 0;
FilePointer = fopen(FileName, "r");
if (NULL == FilePointer)
{
printf("Error opening file %s. Try again...\n", FileName);
FileName[0] = 0;
goto FileSelection;
}
stat(FileName, &st);
Buffer = (unsigned char *)malloc(st.st_size);
fread(Buffer, 1, st.st_size, FilePointer);
DumpData(FileName, Buffer, st.st_size);
struct Fex *FexFile = Buffer;
if (FexFile->Magic[0] != 'F' || FexFile->Magic[1] != 'E' || FexFile->Magic[2] != 'X' || FexFile->Magic[3] != '\0')
{
printf("Invalid FEX header. Checking if it's in an ELF file...\n");
if (st.st_size > 0x1000)
{
struct Fex *FexFile = (struct Fex *)(Buffer + 0x1000);
if (FexFile->Magic[0] != 'F' || FexFile->Magic[1] != 'E' || FexFile->Magic[2] != 'X' || FexFile->Magic[3] != '\0')
{
printf("Invalid FEX header. Exiting...\n");
fclose(FilePointer);
free(Buffer);
return 1;
}
}
else
{
printf("Invalid FEX header. Exiting...\n");
fclose(FilePointer);
free(Buffer);
return 1;
}
}
struct FexExtended *FexExtendedFile = (struct FexExtended *)(Buffer + EXTENDED_SECTION_ADDRESS);
printf("┌FEX File:\n");
printf("├Magic: %c%c%c%c\n", FexFile->Magic[0], FexFile->Magic[1], FexFile->Magic[2], FexFile->Magic[3]);
printf("├Type: %d\n", FexFile->Type);
printf("├Operating System: %d\n", FexFile->OS);
printf("├Entry Point: %#lx\n", FexFile->EntryPoint);
printf("\n");
printf("├FEX Extended Header:\n");
printf("│ ├Executable:\n");
printf("│ │ └<not implemented>\n");
// TODO: Add more stuff to executable category.
printf("│ ├Driver:\n");
printf("│ │ ├Name: %s\n", FexExtendedFile->Driver.Name);
printf("│ │ ├Type: %d\n", FexExtendedFile->Driver.Type);
printf("│ │ ├Callback: %#lx\n", FexExtendedFile->Driver.Callback);
printf("│ │ ├Bind:\n");
printf("│ │ │ ├Type: %d\n", FexExtendedFile->Driver.Bind.Type);
printf("│ │ │ ├Interrupt:\n");
printf("│ │ │ │ └Vectors: ");
for (int i = 0; i < 16; i++)
printf("%#x ", FexExtendedFile->Driver.Bind.Interrupt.Vector[i]);
printf("\n");
printf("│ │ │ ├Process:\n");
printf("│ │ │ │ └Process IDs: ");
for (int i = 0; i < 16; i++)
printf("%d ", FexExtendedFile->Driver.Bind.Process.ProcessId[i]);
printf("\n");
printf("│ │ │ ├PCI:\n");
printf("│ │ │ │ ├Vendor IDs: ");
for (int i = 0; i < 16; i++)
printf("%#x ", FexExtendedFile->Driver.Bind.PCI.VendorID[i]);
printf("\n");
printf("│ │ │ │ ├Device IDs: ");
for (int i = 0; i < 16; i++)
printf("%#x ", FexExtendedFile->Driver.Bind.PCI.DeviceID[i]);
printf("\n");
printf("│ │ │ │ ├Class: %#x\n", FexExtendedFile->Driver.Bind.PCI.Class);
printf("│ │ │ │ ├SubClass: %#x\n", FexExtendedFile->Driver.Bind.PCI.SubClass);
printf("│ │ │ │ └ProgIF: %#x\n", FexExtendedFile->Driver.Bind.PCI.ProgIF);
printf("│ │ │ ├Input:\n");
printf("│ │ │ │ ├Attach to mouse: %s\n", FexExtendedFile->Driver.Bind.Input.AttachToMouse ? "true" : "false");
printf("│ │ │ │ └Attach to keyboard: %s\n", FexExtendedFile->Driver.Bind.Input.AttachToKeyboard ? "true" : "false");
printf("┊ ┊ ┊ ┊\n");
fclose(FilePointer);
free(Buffer);
return 0;
}

82
tools/Makefile Normal file
View File

@ -0,0 +1,82 @@
WORKING_DIR = $(shell pwd)
CROSS_DIR=$(WORKING_DIR)/cross
export PATH := $(CROSS_DIR):$(PATH)
QEMU_VERSION = 8.1.2
all: do_rep do_ep do_limine clone_all do_binutils_64 do_gcc_64 do_binutils_32 do_gcc_32 do_qemu
clean:
rm -f rep ep fex
do_rep:
gcc -w ReadEthernetPackets.c -o rep
chmod +x rep
do_ep:
g++ -w ErrorParser.cpp -o ep
chmod +x ep
do_limine:
git clone https://github.com/limine-bootloader/limine.git --branch=v6.x-branch-binary --depth=1
__clone_qemu:
wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz
tar xvJf qemu-${QEMU_VERSION}.tar.xz
rm -f qemu-${QEMU_VERSION}.tar.xz
mv qemu-${QEMU_VERSION} qemu
__clone_all_no_qemu:
git clone -b binutils-2_42-branch --single-branch https://github.com/Fennix-Project/binutils-gdb.git binutils-gdb
git clone -b releases/gcc-13 --single-branch https://github.com/Fennix-Project/gcc.git gcc
cd gcc && $(shell ./contrib/download_prerequisites)
mkdir -p cross
mkdir -p build-binutils64
mkdir -p build-gcc64
mkdir -p build-binutils32
mkdir -p build-gcc32
clone_all: __clone_qemu __clone_all_no_qemu
do_qemu:
cd qemu && \
bash ./configure --target-list=x86_64-softmmu,i386-softmmu,aarch64-softmmu \
--prefix="$(CROSS_DIR)" \
--enable-gtk --disable-tools \
--disable-gio --disable-virtfs --disable-vnc \
--disable-opengl && \
make -j$(shell nproc) && make install
do_binutils_64:
cd build-binutils64 && \
../binutils-gdb/configure --target=x86_64-fennix \
--prefix="$(CROSS_DIR)" --disable-nls \
--with-sysroot --enable-shared --disable-werror && \
make all -j$(shell nproc) && make install
do_gcc_64:
cd build-gcc64 && \
../gcc/configure --target=x86_64-fennix \
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
--enable-languages=c,c++ --enable-shared --without-headers && \
make all-gcc -j$(shell nproc) && \
make all-target-libgcc -j$(shell nproc) && \
make install-gcc -j$(shell nproc) && \
make install-target-libgcc -j$(shell nproc)
do_binutils_32:
cd build-binutils32 && \
../binutils-gdb/configure --target=i386-fennix \
--prefix="$(CROSS_DIR)" --disable-nls \
--with-sysroot --enable-shared --disable-werror && \
make all -j$(shell nproc) && make install
do_gcc_32:
cd build-gcc32 && \
../gcc/configure --target=i386-fennix \
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
--enable-languages=c,c++ --enable-shared --without-headers && \
make all-gcc -j$(shell nproc) && \
make all-target-libgcc -j$(shell nproc) && \
make install-gcc -j$(shell nproc) && \
make install-target-libgcc -j$(shell nproc)

9
tools/README.md Normal file
View File

@ -0,0 +1,9 @@
# tools
---
In this directory, you will find:
- An error parser for qemu debug output.
- Ethernet packet reader for testing network connection.
- A makefile script to clone and build gcc, binutils and qemu.
- `website` directory containing the source code for the website.

150
tools/ReadEthernetPackets.c Normal file
View File

@ -0,0 +1,150 @@
/* I don't remember where I got this code from, but it seems to work fine for me. */
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/ip.h>
#include <linux/udp.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/ether.h>
enum FrameType
{
TYPE_IPV4 = 0x0800,
TYPE_ARP = 0x0806,
TYPE_RARP = 0x8035,
TYPE_IPV6 = 0x86DD
};
#define ETHER_TYPE TYPE_ARP
#define DEFAULT_IF "enp7s0"
#define BUF_SIZ 1024
int main(int argc, char *argv[])
{
char sender[INET6_ADDRSTRLEN];
int sockfd, ret, i;
int sockopt;
ssize_t numbytes;
struct ifreq ifopts;
struct ifreq if_ip;
struct sockaddr_storage their_addr;
uint8_t buf[BUF_SIZ];
char ifName[IFNAMSIZ];
int ether_type = TYPE_ARP;
if (argc > 1)
{
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)
{
printf("Usage: sudo %s [type] [interface]\nTypes:\n 0 - IPv4 1 - ARP 2 - RARP 3 - IPv6\nExample: sudo %s 1 enp7s0", argv[0], argv[0]);
return 0;
}
if (argv[1] > '9' || argv[1] < '0')
{
switch (atoi(argv[1]))
{
case 0:
ether_type = TYPE_IPV4;
break;
case 1:
ether_type = TYPE_ARP;
break;
case 2:
ether_type = TYPE_RARP;
break;
case 3:
ether_type = TYPE_IPV6;
break;
default:
printf("Invalid type.\n");
return -1;
}
}
else
{
printf("Invalid ethernet type \"%d\".", atoi(argv[1]));
return -1;
}
}
if (argc > 2)
strcpy(ifName, argv[2]);
else
strcpy(ifName, DEFAULT_IF);
printf("Using interface \"%s\" with type %#lx \n", ifName, ether_type);
if (geteuid() != 0)
{
perror("You must be root to run this program.");
return -1;
}
struct ether_header *eh = (struct ether_header *)buf;
struct iphdr *iph = (struct iphdr *)(buf + sizeof(struct ether_header));
struct udphdr *udph = (struct udphdr *)(buf + sizeof(struct iphdr) + sizeof(struct ether_header));
memset(&if_ip, 0, sizeof(struct ifreq));
if ((sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETHER_TYPE))) == -1)
{
perror("Error creating socket");
return -1;
}
strncpy(ifopts.ifr_name, ifName, IFNAMSIZ - 1);
ioctl(sockfd, SIOCGIFFLAGS, &ifopts);
ifopts.ifr_flags |= IFF_PROMISC;
ioctl(sockfd, SIOCSIFFLAGS, &ifopts);
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof sockopt) == -1)
{
perror("setsockopt failed");
close(sockfd);
exit(EXIT_FAILURE);
}
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifName, IFNAMSIZ - 1) == -1)
{
perror("Failed to bind socket to device");
close(sockfd);
exit(EXIT_FAILURE);
}
repeat:
printf("Waiting to recvfrom... ");
numbytes = recvfrom(sockfd, buf, BUF_SIZ, 0, NULL, NULL);
printf("got packet %lu bytes\n", numbytes);
if (eh->ether_dhost[0] == 0 && eh->ether_dhost[1] == 0 && eh->ether_dhost[2] == 0 && eh->ether_dhost[3] == 0 && eh->ether_dhost[4] == 0 && eh->ether_dhost[5] == 0)
printf("MAC <: %x:%x:%x:%x:%x:%x\n", eh->ether_dhost[0], eh->ether_dhost[1], eh->ether_dhost[2], eh->ether_dhost[3], eh->ether_dhost[4], eh->ether_dhost[5]);
else
{
printf("MAC X: %x:%x:%x:%x:%x:%x\n", eh->ether_dhost[0], eh->ether_dhost[1], eh->ether_dhost[2], eh->ether_dhost[3], eh->ether_dhost[4], eh->ether_dhost[5]);
ret = -1;
goto done;
}
((struct sockaddr_in *)&their_addr)->sin_addr.s_addr = iph->saddr;
inet_ntop(AF_INET, &((struct sockaddr_in *)&their_addr)->sin_addr, sender, sizeof sender);
strncpy(if_ip.ifr_name, ifName, IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFADDR, &if_ip) >= 0)
{
printf("Source IP: %s My IP: %s\n", sender, inet_ntoa(((struct sockaddr_in *)&if_ip.ifr_addr)->sin_addr));
if (strcmp(sender, inet_ntoa(((struct sockaddr_in *)&if_ip.ifr_addr)->sin_addr)) == 0)
{
ret = -1;
goto done;
}
}
ret = ntohs(udph->len) - sizeof(struct udphdr);
done:
goto repeat;
close(sockfd);
return ret;
}

BIN
tools/SSDT1.dat Normal file

Binary file not shown.

67
tools/custom.css Normal file
View File

@ -0,0 +1,67 @@
:root {
--primary-color: #00559f;
--primary-dark-color: #1982d2;
--primary-light-color: #4779ac;
--primary-lighter-color: #191e21;
--primary-lightest-color: #191a1c;
--box-shadow: 0 2px 10px 0 rgba(0,0,0,.35);
--odd-color: rgba(0,0,0,.1);
--menu-selected-background: rgba(0,0,0,.4);
--page-background-color: #1C1D1F;
--page-foreground-color: #d2dbde;
--page-secondary-foreground-color: #859399;
--separator-color: #000000;
--side-nav-background: #252628;
--code-background: #2a2c2f;
--tablehead-background: #2a2c2f;
--blockquote-background: #1f2022;
--blockquote-foreground: #77848a;
--warning-color: #b61825;
--warning-color-dark: #510a02;
--warning-color-darker: #f5b1aa;
--note-color: rgb(255, 183, 0);
--note-color-dark: #9f7300;
--note-color-darker: #fff6df;
--deprecated-color: rgb(88, 90, 96);
--deprecated-color-dark: #262e37;
--deprecated-color-darker: #a0a5b0;
--bug-color: rgb(248, 113, 0);
--bug-color-dark: #812a00;
--bug-color-darker: #ffd3be;
}
div.contents div.dyncontent img {
filter: hue-rotate(180deg) invert();
}
.iconfopen, .iconfclosed {
filter: hue-rotate(180deg) invert();
}
#nav-path li.navelem:after {
text-shadow: 3px 0 0 var(--separator-color), 8px 0 6px rgba(0,0,0,0.4);
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: rgb(40, 40, 40);
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}

1364
tools/doxygen-awesome.css Normal file

File diff suppressed because it is too large Load Diff

47
tools/grub.cfg Normal file
View File

@ -0,0 +1,47 @@
set default=0
set timeout=1
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry "Fennix" {
load_video
clear
echo "Loading kernel"
multiboot2 /fennix.elf --ioapicirq=1 --udl=true --simd=true --linux=true --init=/bin/init
echo "Loading initrd"
module2 /initrd.tar initrd
echo "Booting..."
boot
}
menuentry 'Boot from next volume' {
exit 1
}
if [ ${grub_platform} == "efi" ]; then
menuentry 'UEFI Firmware Settings' {
fwsetup
}
fi
menuentry "System restart" {
reboot
}
menuentry "System shutdown" {
halt
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

12
tools/limine.cfg Normal file
View File

@ -0,0 +1,12 @@
TIMEOUT=1
INTERFACE_BRANDING=Fennix
:Fennix (limine)
# DO NOT EDIT!
COMMENT=Boot Fennix using limine protocol
PROTOCOL=limine
KERNEL_CMDLINE=--ioapicirq=1 --udl=true --simd=true
KERNEL_PATH=boot:///fennix.elf
MODULE_PATH=boot:///initrd.tar
MODULE_CMDLINE=initrd

2
tools/lynx.cfg Normal file
View File

@ -0,0 +1,2 @@
CMDLINE=debug
INITRD=initrd.tar

214
tools/website/css/style.css Normal file
View File

@ -0,0 +1,214 @@
html {
scroll-behavior: smooth;
}
body {
background-color: #000;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
font-family: 'Open Sans', sans-serif;
z-index: -1;
margin: 0;
}
.background_main {
background-image: linear-gradient(121deg, rgb(0, 0, 0) 40%, rgb(72, 0, 140) 40%, rgb(0, 16, 80) 76%, rgb(72, 0, 0) 100%);
background-size: 400% 400%;
height: 100vh;
animation: gradient 4s ease-out;
animation-fill-mode: forwards;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
100% {
background-position: 100% 50%;
}
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: rgb(40, 40, 40);
}
::-webkit-scrollbar-thumb {
background: #888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
.on-background-text {
color: #f2f2f2;
}
.move-to-middle {
text-align: center;
}
.move-to-left {
text-align: left;
}
.move-to-right {
text-align: right;
}
.navbar {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgb(15, 15, 15, 0.8);
position: sticky;
top: 0;
z-index: 101;
}
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.navbar a:hover {
background-color: rgb(80, 0, 100, 0.5);
}
.navbar a.active {
background-color: rgb(100, 0, 180, 0.5);
}
.navbar a.active_f {
background-color: rgb(100, 0, 180, 0.5);
}
.navbar .icon {
display: none;
}
.content-buttons {
background-color: rgb(20, 20, 20);
}
.button {
background-color: rgb(15, 15, 15, 0.1);
/* #964caf; */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
.button:hover {
background-color: rgb(80, 0, 100, 0.5);
/* #872ea5; */
color: white;
}
.header {
background-color: rgb(15, 15, 15, 0.8);
color: #f2f2f2;
text-align: center;
padding: 5px;
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(10px);
}
footer {
text-align: center;
background-color: rgb(15, 15, 15, 0.8);
color: white;
overflow: hidden;
position: fixed;
bottom: 0;
width: 100%;
z-index: 104;
backdrop-filter: blur(10px);
}
.round-border-low {
border-radius: 2px;
}
.round-border-med {
border-radius: 6px;
}
.round-border-high {
border-radius: 16px;
}
.panel {
background: rgba(177, 177, 177, 0.2);
backdrop-filter: blur(40px);
box-shadow: 1px 1px 2px rgb(255, 255, 255), 0 0 0.2em rgb(0, 42, 167), 0 0 0.5em rgb(81, 0, 144);
border-radius: 4px;
padding-left: 4px;
padding-right: 4px;
}
#backToTopBtn {
backdrop-filter: blur(10px);
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 105;
border: none;
outline: none;
background-color: rgb(100, 0, 180, 0.5);
color: white;
cursor: pointer;
padding: 15px;
border-radius: 10px;
font-size: 18px;
}
#backToTopBtn:hover {
background-color: rgb(80, 0, 100, 0.5);
}
.stroketext {
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.parallax {
min-height: 1000px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.gradienttext {
color: #eee;
text-transform: capitalize;
background: linear-gradient(-45deg, #09f1b8, #00a2ff, #920077, #fed90f);
background-size: 100% 100%;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-stroke: 10px transparent;
}
.glowtext {
text-shadow: 1px 1px 2px red, 0 0 2em rgb(0, 42, 167), 0 0 1.2em rgb(50, 0, 88);
}

137
tools/website/index.html Normal file
View File

@ -0,0 +1,137 @@
<html>
<head>
<title>Fennix</title>
<link rel="stylesheet" href="css/style.css">
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css'>
<link rel="icon" href="assets/favicon.png">
</head>
<body ondragstart="return false;" ondrop="return false;">
<div class="header background_main" style="font-size: 40px;">
<div style="position: relative; top: 40%; transform: translateY(-40%);">
<h1 class="on-background-text move-to-middle gradienttext glowtext">Fennix</h1>
<h4 class="on-background-text move-to-middle glowtext">Operating System from scratch made in C and C++</h4>
<button class="button round-border-med hdrbtn" style="backdrop-filter: blur(10px); cursor: pointer;" onclick="window.location.href='https://github.com/Fennix-Project/Fennix/releases'">Download Stable
Version</button>
<button class="button round-border-med hdrbtn" style="backdrop-filter: blur(10px); cursor: pointer;" onclick="window.location.href='https://github.com/Fennix-Project/Fennix/actions/workflows/makefile.yml'">Download
Unstable Version</button>
</div>
</div>
<div class="navbar" style="backdrop-filter: blur(10px);">
<a class="on-background-text move-to-middle gradienttext">Fennix</a>
<a class="hdrbtn" href="https://github.com/Fennix-Project/Fennix"><i class="fa-brands fa-git-alt"></i>
Contribute</a>
<a class="hdrbtn" href="/fulldoc"><i class="fa-solid fa-book-bookmark"></i> Full Documentation</a>
<a class="hdrbtn" href="/lynx"><i class="fa-solid fa-file-code"></i> Lynx Bootloader</a>
<a class="hdrbtn" href="/kernel"><i class="fa-solid fa-file-code"></i> Kernel</a>
<a class="hdrbtn" href="/drivers"><i class="fa-solid fa-file-code"></i> Drivers</a>
<a class="hdrbtn" href="/userspace"><i class="fa-solid fa-file-code"></i> Userspace</a>
<a class="hdrbtn" style="float:right" href="https://github.com/Fennix-Project/Fennix/releases/latest"><i
class="fa-solid fa-download"></i> Download</a>
</div>
<div class="header" style="padding-bottom: 250px; padding-left: 0px; backdrop-filter: blur(40px);">
<div style="padding-top: 25px;">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/Fennix-Project/Fennix/Build%20OS?style=for-the-badge" onclick="window.location.href='https://github.com/Fennix-Project/Fennix/actions/workflows/makefile.yml'">
<img alt="GitHub" src="https://img.shields.io/github/license/Fennix-Project/Fennix?style=for-the-badge">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/Fennix-Project/Fennix?style=for-the-badge">
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/Fennix-Project/Fennix?label=Repo%20Stars&style=for-the-badge">
</div>
<div>
<h1 class="gradienttext" style="font-size: 50px;">About</h1>
<table style="float: right;">
<tbody>
<tr>
<th>
<iframe src="https://discord.com/widget?id=887406812612157451&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>
</th>
</tr>
</tbody>
</table>
<div style="padding-top: 100px; font-size: 35px;">
Hello!<br> This is my Operating System from scratch, my goal is to make a fully functional Operating System with a GUI and a lot of features.<br> I'm working on this project alone, but I'm open to any kind of help, if you want to help
me, you can contribute to the project on GitHub.<br> I have a Discord server too &#8594<br>
</div>
</div>
<div style="font-size: 20px;">
<hr color="#292929" style="margin-top: 250px;">
<h1 class="gradienttext" style="padding-top: 100px; font-size: 50px;">Compiling Instructions</h1>
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
<h4>Requirements</h4>
First of all, you need to install the required packages to build the cross-compiler, bootloader, OS, etc.
<br>
<hr color="#292929">
<b>&#x2022; Ubuntu 22.04</b><br> For cross-compiler:<br>
<code class="panel">sudo apt install build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libzstd-dev libisl-dev autoconf m4 automake gettext gperf dejagnu guile-3.0 guile-3.0-dev expect tcl autogen tex-common sphinx-common git ssh diffutils patch
<i class="fa-solid fa-clipboard" style="cursor: pointer;" title="Copy to clipboard" onclick="CopyToClipboard('sudo apt install build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libzstd-dev libisl-dev autoconf m4 automake gettext gperf dejagnu guile-3.0 guile-3.0-dev expect tcl autogen tex-common sphinx-common git ssh diffutils patch');return false;"></i></code><br> For bootloader:<br>
<code class="panel">sudo apt-get install make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64
<i class="fa-solid fa-clipboard" style="cursor: pointer;" title="Copy to clipboard" onclick="CopyToClipboard('sudo apt-get install make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64');return false;"></i></code><br> For QEMU you'll have to follow this page <a href="https://wiki.qemu.org/Hosts/Linux" target="_blank">here</a><br> For OS:<br>
<code class="panel">sudo apt-get install xorriso mtools genisoimage ovmf nasm doxygen
<i class="fa-solid fa-clipboard" style="cursor: pointer;" title="Copy to clipboard" onclick="CopyToClipboard('sudo apt-get install xorriso mtools genisoimage ovmf nasm doxygen');return false;"></i>
</code><br>
</div>
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
<h4 style="padding-top: 50px;">Building The Cross-Compiler</h4>
The cross-compiler is used to compile the OS, the bootloader and the kernel.<br>
<hr color="#292929"> All you have to do is to write this command in the terminal:<br>
<code class="panel">make tools</code><br> You'll have to wait a while, but when it's done, you can jump to the next step.<br>
</div>
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
<h4 style="padding-top: 50px;">Configuring your kernel</h4>
If you want to build different architecture, use other QEMU binary or change kernel name you can find in
<code class="panel">Makefile.conf</code> file.<br>
<hr color="#292929">
<code class="panel">DEBUG</code> &#x2022; If it's set to <code class="panel">1</code>, the kernel will be compiled in debug mode.<br>
<code class="panel">TESTING</code> &#x2022; Enable unit testing.<br>
<code class="panel">OSNAME</code> &#x2022; The name of the kernel. This can be anything.<br>
<code class="panel">OSARCH</code> &#x2022; The architecture of the kernel. Supported values are: <code class="panel">amd64</code> <code class="panel">i386</code> <code class="panel">aarch64</code>.<br>
<code class="panel">KERNEL_VERSION</code> &#x2022; The version of the kernel. This can be anything.<br>
<code class="panel">BOOTLOADER</code> &#x2022; The bootloader to be used. If set to <code class="panel">other</code>, the bootloader will be <a href="https://github.com/limine-bootloader/limine" target="_blank">Limine</a> for 64-bit, or
with <a href="https://www.gnu.org/software/grub/" target="_blank">GRUB</a> if 32-bit. <code class="panel">lynx</code> it's still under development.<br>
<code class="panel">COMPILER_PATH</code> &#x2022; The path of the cross compiler. If you want to use your own cross compiler, change it to the path of the compiler.<br>
<code class="panel">LIMINE_FOLDER</code> &#x2022; The path of the Limine bootloader.<br>
<code class="panel">QEMU_PATH</code> &#x2022; Qemu path. If you want to use the one you have installed in your system, change it to /usr/bin/qemu-system- (do not include x86_64 or i386, it will be added automatically)
<br> That's all you can change in this file.<br>
</div>
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
<h4 style="padding-top: 50px;">Building The Operating System</h4>
The fun part!<br>
<hr color="#292929"> Now that you have the cross-compiler, you can build the OS.<br> There are a few commands that you can use to compile the OS:<br>
<code class="panel">make build</code> &#x2022; Builds the entire OS and creates an ISO image.<br>
<code class="panel">make run</code> &#x2022; Same as <code class="panel">make build</code> but starts the QEMU too.<br>
<code class="panel">make clean</code> &#x2022; Clean all files (object files, ISO, etc...).<br>
<code class="panel">make doxygen</code> &#x2022; Generate the documentation in directory <code class="panel">doxygen-doc</code>.<br>
</div>
</div>
<div style="font-size: 20px; padding-top: 100px;">
<h1 style="font-size: 50px;" class="gradienttext">Running With Other Virtual Machines</h1>
<hr color="#292929">
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
&#x2022; On VirtualBox and VMware, you can use the ISO image to run the OS.<br> &#x2022; HDD/SSD are not required.<br> &#x2022; The minimum RAM required is 4G. You can run with lower memory, but sometimes can cause issues (I don't know
why).<br> &#x2022; UEFI required. BIOS sometimes doesn't work properly.<br> &#x2022; Serial Port (COM1) is recommended.<br>
</div>
</div>
<div style="font-size: 20px; padding-top: 100px;">
<h1 style="font-size: 50px;" class="gradienttext">Reporting Issues</h1>
<hr color="#292929">
<div style="text-align: left; margin-left: 10px; margin-right: 10px;">
You can report bugs or crash issues to <a href="https://github.com/Fennix-Project/Fennix/issues/new?assignees=&labels=bug&template=bug_report.md&title=">Issues
tab</a>.<br>
</div>
</div>
<button style="z-index: 105; position: absolute;" onclick="topScript()" id="backToTopBtn">Up</button>
<footer class="blur">
<p>© EnderIce2 <span id="year"></span></p>
<script src="js/script.js"></script>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,55 @@
document.querySelectorAll(".hdrbtn").forEach((b) => {
b.onmouseleave = (e) => {
e.target.style.background = "rgb(15, 15, 15, 0.1)";
e.target.style.borderImage = null;
};
b.addEventListener("mousemove", (e) => {
const rect = e.target.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
e.target.style.background = `radial-gradient(circle at ${x}px ${y}px , rgba(100, 0, 180, 0.5),rgba(15, 15, 15, 0.1) )`;
e.target.style.borderImage = `radial-gradient(20% 75% at ${x}px ${y}px ,rgba(255, 255, 255, 0.7),rgba(255, 255, 255, 0.1) ) 1 / 1px / 0px stretch `;
});
});
document.getElementById("year").innerHTML = new Date().getFullYear();
topButton = document.getElementById("backToTopBtn");
window.onscroll = function () { scrollToTop(); };
function scrollToTop() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
topButton.style.display = "block";
} else {
topButton.style.display = "none";
}
}
function topScript() {
window.scroll({
top: 0,
behavior: 'smooth'
});
}
function CopyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
return window.clipboardData.setData("Text", text);
}
else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.select();
try {
return document.execCommand("copy");
}
catch (ex) {
console.warn("Copy to clipboard failed.", ex);
return prompt("Copy to clipboard: Ctrl+C, Enter", text);
}
finally {
document.body.removeChild(textarea);
}
}
}

6
tools/website/robots.txt Normal file
View File

@ -0,0 +1,6 @@
User-agent: *
Disallow: /userspace/
Disallow: /drivers/
Disallow: /kernel/
Disallow: /lynx/
Disallow: /fulldoc/