Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/max-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
run: |
cd toolchain/pre_process
./version.sh --force
./symbols.sh pre ../../kernel/include/common/symbols.h
cd ../../
mkdir -p cmake-build
cd cmake-build
cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain/CMakeToolchain.txt
mkdir -p cmake-release
cd cmake-release
cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain/CMakeToolchain.txt -DCMAKE_BUILD_TYPE=Release
make install

- name: Upload binary
Expand All @@ -67,6 +68,9 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install epstopdf
run: sudo apt-get update && sudo apt-get install -y texlive-font-utils

- name: Generate Docs
run: |
cd toolchain
Expand Down
23 changes: 22 additions & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
ENDIF()

# Set flags based on build type
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-DTARGET_DEBUG)
ENDIF()

# Function to make a library easier
function(MAKE_LIBRARY LIBNAME)

Expand Down
108 changes: 76 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,44 @@


<!-- ABOUT THE PROJECT -->

## About The Project

[![MaxOS][product-screenshot]](#)

Max OS is a hobby operating system developed for the 64bit platform using C++ and Assembly. The project is currently in
the early stages of development and is not yet ready for use. The project is being developed as a learning experience
and is not intended to be used as a production operating system.

Max OS is a hobby operating system developed for the 64bit platform using C++ and Assembly. The project is currently in the early stages of development and is not yet ready for use. The project is being developed as a learning experience and is not intended to be used as a production operating system.

Max OS supports device drivers, memory management, multitasking, a GUI, and more. The project is being developed with the goal of being able to run on real hardware, however, it is currently only able to run on a virtual machine.

This GitHub repository contains the source code for the operating system, as well as the build scripts required to build the operating system from source. The repository also contains the latest built kernel, which can be downloaded from the workflow artifacts. To ensure a cleaner git history, each feature/change is done in a separate branch and then merged into the main branch once working. To see the history of each feature press on the pull request number. If you are intrested in the active development find the latest branch <a href="https://github.com/maxtyson123/MaxOS/branches">Here</a>.
Max OS supports device drivers, memory management, multitasking, a GUI, and more. The project is being developed with
the goal of being able to run on real hardware, however, it is currently only able to run on a virtual machine.

This GitHub repository contains the source code for the operating system, as well as the build scripts required to build
the operating system from source. The repository also contains the latest built kernel, which can be downloaded from the
workflow artifacts. To ensure a cleaner git history, each feature/change is done in a separate branch and then merged
into the main branch once working. To see the history of each feature press on the pull request number. If you are
intrested in the active development find the latest branch <a href="https://github.com/maxtyson123/MaxOS/branches">
Here</a>.

_Note:_ Ignore all the networking code & drivers, they are very outdated, badly written and will soon be ported over to userspace and rewritten.
_Note:_ Ignore all the networking code & drivers, they are very outdated, badly written and will soon be ported over to
userspace and rewritten.
<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- GETTING STARTED -->

## Getting Started

This is how to build the Max OS operating system from source. (Alternatively, you can download the latest built kernel from the workflow artifacts)
This is how to build the Max OS operating system from source. (Alternatively, you can download the latest built kernel
from the workflow artifacts)

Currently, Max OS can only be built on a linux-like machine, but does support WSL & Mac. If you are using WSL, make sure the repo is on the WSL machine and not the Windows machine.
Currently, Max OS can only be built on a linux-like machine, but does support WSL & Mac. If you are using WSL, make sure
the repo is on the WSL machine and not the Windows machine.

### Prerequisites

This is the list of required packages to build the operating system from source. (Note the build scripts should install these automatically)
This is the list of required packages to build the operating system from source. (Note the build scripts should install
these automatically)

* build-essential
* bison
* flex
Expand All @@ -106,26 +119,28 @@ This is the list of required packages to build the operating system from source.
* rsync

Linux:

```sh
sudo apt update
sudo apt install -y build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo libisl-dev cmake telnet
```

Mac:

```sh
# Install Devtools (via Xcode or some other method)
# Install Homebrew
brew install coreutils bison gmp libmpc mpfr texinfo gcc@13 cmake nasm telnet
```


Note: If you want to run the operating system in a virtual machine, you will need to install QEMU. (If in WSL the script will look for a Windows installation of QEMU)
Note: If you want to run the operating system in a virtual machine, you will need to install QEMU. (If in WSL the script
will look for a Windows installation of QEMU)

### Installation

- Upon first build follow steps 1-5
- If you change the file structure (e.g. add a new file) follow steps 3-5
- If you're running on a new boot (eg you rebooted your computer) follow steps 4-5
- If you're running on a new boot (e.g. you rebooted your computer) follow steps 4-5
- If you only change a file follow step 5

1. Clone the repo
Expand Down Expand Up @@ -160,42 +175,49 @@ Note: If you want to run the operating system in a virtual machine, you will nee
# Replace 'run' with 'gdb' on a debug build to make the kernel wait for gdb to attach on port 1234
make run
```
6. (OPTIONAL) I use CLion IDE for development, if you want to use it too follow these steps for IDE features:

6. (OPTIONAL) I use CLion IDE for development, if you want to use it to follow these steps for IDE features:
- Cmake
- Open CLion
- Select "Open or Import"
- Select the `CMakeLists.txt` file in the root directory of the project
- Make sure the profile is set to these settings:
- CMake: `cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain/CMakeToolchain.txt`
- Directory: `cmake-[release/debug]`
- Click "OK"
- Wait for CLion to index the project (this may take a while)
- Open CLion
- Select "Open or Import"
- Select the `CMakeLists.txt` file in the root directory of the project
- Make sure the profile is set to these settings:
- CMake: `cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain/CMakeToolchain.txt`
- Directory: `cmake-[release/debug]`
- Click "OK"
- Wait for CLion to index the project (this may take a while)
- Code Style
- Go to Settings -> Editor -> Code Styles -> (cog) -> Import Scheme -> C/C++ -> Import Scheme -> From `docs/Styles/ClionCodeStyleSettings.xml`
- Go to Settings -> Editor -> Code Styles -> (cog) -> Import Scheme -> C/C++ -> Import Scheme -> From
`docs/Styles/ClionCodeStyleSettings.xml`
- Debugger
- Run a gdb build with `make gdb`
- Create new configuration: Edit Configurations -> Add -> Remote Debugger
-
- Run a gdb build with `make gdb`
- Create new configuration: Edit Configurations -> Add -> Remote Debugger
-

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- USAGE EXAMPLES -->

## Usage

No user usage so far (userland will be added in the future)

#### Boot Console

![Boot Console](docs/Screenshots/Boot/Console_v3.png)

#### GUI

![GUI](docs/Screenshots/GUI/Windows_VESA.png)

<!-- ROADMAP -->

## Roadmap

#### Core Kernel

- [x] Bootloader
- [x] GDT
- [x] IDT
Expand All @@ -220,34 +242,39 @@ No user usage so far (userland will be added in the future)
- [ ] Clean up ALL Todos

#### Userland

- [ ] GUI
- [ ] Terminal
- [ ] Connect to Clion with SMB for files and GDB for debugging in userspace
- [ ] connect to Clion with SMB for files and GDB for debugging in userspace
- [ ] DOOM Port
- [ ] Self-hosted os
- [ ] GUI Framework
- [ ] App Framework & System Apps
- [ ] Auto Updater & Image Builder (ISO Release)
- [ ] Store
- [ ] store
- [ ] Security of some sort
- [ ] User Switching
- [ ] Real Hardware Support
- [ ] Port NeoVim, Wakatime & Some hot reloader
- [ ] Create port of my 2048
- [ ] Own LibC

See the [open issues](https://github.com/maxtyson123/MaxOS/issues) for a full list of proposed features (and known issues).

See the [open issues](https://github.com/maxtyson123/MaxOS/issues) for a full list of proposed features (and known
issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>



<!-- CONTRIBUTING -->

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any
contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also
simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
Expand All @@ -261,6 +288,7 @@ Don't forget to give the project a star! Thanks again!


<!-- LICENSE -->

## License

Distributed under the BSD 3-Clause License. See `LICENSE` for more information.
Expand All @@ -269,6 +297,7 @@ Distributed under the BSD 3-Clause License. See `LICENSE` for more information.


<!-- ACKNOWLEDGMENTS -->

## Acknowledgments

* [OSDev.org](https://wiki.osdev.org/)
Expand All @@ -283,19 +312,34 @@ Distributed under the BSD 3-Clause License. See `LICENSE` for more information.

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[product-screenshot]: docs/Screenshots/Boot/Console_v3.png

[contributors-shield]: https://img.shields.io/github/contributors/maxtyson123/MaxOS.svg?style=for-the-badge

[contributors-url]: https://github.com/maxtyson123/MaxOS/graphs/contributors

[forks-shield]: https://img.shields.io/github/forks/maxtyson123/MaxOS.svg?style=for-the-badge

[forks-url]: https://github.com/maxtyson123/MaxOS/network/members

[stars-shield]: https://img.shields.io/github/stars/maxtyson123/MaxOS.svg?style=for-the-badge

[stars-url]: https://github.com/maxtyson123/MaxOS/stargazers

[issues-shield]: https://img.shields.io/github/issues/maxtyson123/MaxOS.svg?style=for-the-badge

[issues-url]: https://github.com/maxtyson123/MaxOS/issues

[built-shield]: https://img.shields.io/github/actions/workflow/status/maxtyson123/MaxOS/max-os.yml?style=for-the-badge

[built-url]: https://github.com/maxtyson123/MaxOS/actions/workflows/max-os.yml

[loc-shield]: https://tokei.rs/b1/github/maxtyson123/MaxOS?style=for-the-badge

[loc-url]: https://github.com/maxtyson123/MaxOS

[wakatime-shield]: https://wakatime.com/badge/github/maxtyson123/MaxOS.svg?style=for-the-badge

[wakatime-url]: https://wakatime.com/badge/github/maxtyson123/MaxOS

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The following behaviors are considered harassment and are unacceptable within ou
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someone's consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Unwelcome sexual attention. This includes, sexualised comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We love your input! We want to make contributing to this project as easy and tra
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## Code Standard
To keep the code understandable please make sure it is formatted and reable. Please look in the coding style [docs](Styles/Coding%20Style.md) for more information.
To keep the code understandable please make sure it is formatted and readable. Please look in the coding style [docs](Styles/Coding%20Style.md) for more information.

## We Use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
Expand All @@ -26,7 +26,7 @@ Pull requests are the best way to propose changes to the codebase (we use [GitHu
## Report bugs using GitHub's [issues](https://github.com/briandk/transcriptase-atom/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/maxtyson123/MaxOS/issues/new/choose); it's that easy!

## Write bug reports with detail, background, and sample code
## write bug reports with detail, background, and sample code
[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report someone wrote on stack overflow.

**Great Bug Reports** tend to have:
Expand Down
17 changes: 9 additions & 8 deletions docs/Idle.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## How the idle proc works:
I was debugging along and released that on the first ever schedule it will
set current_thread->execution_state = cpu_state; where it is assumed cpu_state
is the current thread state (ie what we have just been scheduling) and
thus saves it in that thread. However, as the first thread has not had a
chance to be scheduled yet, the current state is not the expected first
thread's state and instead is the cpu state of the kernel.
Now I could either fix that or leave it in as a cool way of never fully
leaving kernelMain and also having a idle_proc

I was debugging along and released that on the first ever schedule it will
set current_thread->execution_state = cpu_state; where it is assumed cpu_state
is the current thread state (ie what we have just been scheduling) and
thus saves it in that thread. However, as the first thread has not had a
chance to be scheduled yet, the current state is not the expected first
thread's state and instead is the cpu state of the kernel.
Now I could either fix that or leave it in as a cool way of never fully
leaving kernelMain and also having an idle_proc
Loading