Compare commits

...

28 Commits

Author SHA1 Message Date
e296655010 Update '.drone.yml' 2022-06-19 14:08:29 +00:00
quackerd
2bdb8dae04 update drone 2020-06-02 06:39:47 +00:00
quackerd
42d2c1383e update drone 2020-06-02 06:38:38 +00:00
quackerd
07d1bc7f6f Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 09:12:52 +00:00
quackerd
b79cd6b1d6 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 09:03:55 +00:00
3f717e476e
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 05:00:36 -04:00
af324eefd4
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 04:53:13 -04:00
cf99debcb4
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 04:50:46 -04:00
35215486ec
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 04:45:55 -04:00
c471a67090 Merge branch 'master' of ssh://git.quacker.org/d/bond 2020-04-23 04:44:55 -04:00
0ff3954be7
drone CI 2020-04-23 04:44:38 -04:00
quackerd
0327c24b11 Update 'LICENSE'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 07:30:44 +00:00
quackerd
b71c7ea715 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 07:26:17 +00:00
quackerd
a7fa953214 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 07:25:08 +00:00
quackerd
a578e85ba0 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 07:24:39 +00:00
7e1e301005
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 02:23:41 -04:00
d80d1dabcd
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-23 02:07:49 -04:00
quackerd
93dae7a29d Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-22 21:24:40 +00:00
quackerd
7560c06c0c Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-22 21:22:44 +00:00
4a72667a0f
drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2020-04-22 16:48:07 -04:00
9fa56f89e9 Merge branch 'working' 2019-12-07 03:56:34 -05:00
quackerd
4047de21ad Update 'README.md' 2019-11-28 18:18:47 +00:00
quackerd
b0ad3eba32 Update 'README.md' 2019-11-28 18:18:09 +00:00
quackerd
7f880a403a Update 'README.md' 2019-11-28 18:16:58 +00:00
quackerd
747e6b9825 Update 'README.md' 2019-11-28 18:13:04 +00:00
acc6ba7601 Merge branch 'working' of d/bond into master 2019-11-28 18:04:56 +00:00
QuackeR
a918d405bb Update README.md 2019-05-28 18:49:59 +00:00
QuackeR
c499ac6355 Update README.md 2019-05-28 18:24:53 +00:00
4 changed files with 67 additions and 23 deletions

41
.drone.yml Normal file
View File

@ -0,0 +1,41 @@
kind: pipeline
type: docker
name: default
trigger:
branch:
- master
event:
exclude:
- cron
steps:
- name: build
image: quackerd/fedora:latest
commands:
- mkdir build
- cd build
- cmake ../
- make
---
kind: pipeline
type: docker
name: docker-update
trigger:
event:
- cron
cron:
- weekly
steps:
- name: docker-update
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: quackerd/fedora
tags: latest

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM fedora:latest
RUN dnf install -y cmake make clang nasm xorriso lld grub2-pc-modules grub2-tools-extra
CMD ["/bin/sh"]

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 secXsQuared
Copyright (c) 2020 quackerd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,45 +1,45 @@
[![Build Status](https://ci.quacker.org/api/badges/d/bond/status.svg)](https://ci.quacker.org/d/bond)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# Building
### Required packages
For compiling kernel only (make compile):
nasm, clang, lld, llvm
To make bootable ISO (make all):
xorriso; grub-pc-bin for bios; grub-efi-amd64-bin, mtools for UEFI.
Fedora: dnf install -y cmake make clang nasm xorriso lld grub2-pc-modules grub2-tools-extra
### Compiling
Run "make all" or "make compile" in the root directory.
mkdir build
This will generate secxkrnl.elf, secxkrnl.dmp, (and secxkrnl.iso) in "out" folder
cd build
Run "make clean" to clean a build.
cmake ../
make
# Running
Load the iso with your favorite simulator or use "-kernel" option with QEMU.
Load the iso with QEMU/your favorite simulator.
For UEFI simulation, use qemu_bios.bin in the root dir with QEMU.
# C++
# C vs C++
I would like my kernel code to be explicit so that I can reason about performance, memory allocation/deallocation. That mostly means when I look at a statement I know exactly what it does.
The philosophy overlaps with Go's design quite a lot: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html.
Using fully-featured C++ is overly complicated for kernels and I'm dubious of OOP in general. With "modern" C++ sometimes I find myself struggling more with the language itself than getting work done. Although the kernel is compiled with a C++ compiler, the base is very much C and we only add few nice things we can benefit from C++:
Using fully-featured C++ is overly complicated for kernels and I'm dubious of OOP in general. Especially while enforcing "modern" C++, sometimes I find myself struggling more with the language itself than getting work done. **I have had lengthy thoughts myself regarding C++ but decided to drop it**. Here are some of the pros and cons I came up with.
## Stronger types
## Good features
### Stronger types
C++ is stronger typed than C. Simply compiling the kernel itself with a C++ compiler provides more type safety than C.
## C++ style casts (no dynamic_cast)
### C++ style casts (no dynamic_cast)
They are compile time casts so no runtime overhead. They provide a bit better type safety than C style casts. The only two casts we would need are probably const_cast and reinterpret_cast.
## template
For type safety for data structures. Linux's list.h isn't type safe. FreeBSD's queue.h tries to mimic templates with macros, which is less elegant than just using template.
### template
For type safety for data structures. Linux's list.h isn't type safe. FreeBSD's queue.h tries to mimic templates with macros, which is less elegant than just using template. Update: this might not be true after trying to implement type safe in-place linked list in C++. I feel like template is just as inelegant for that.
## namespace
### namespace
Oh boy how I wish C standard would include namespace, if it weren't for backward compaibility and stable ABI.
## Banned features worth mentioning
### Ownership management
But rust did better?
## Banned features (tentative)
This list explains SOME of the banned features that might seem useful.
### Class and ctors/dtors
@ -63,4 +63,4 @@ Think about what "f();" could mean in C++ and the code executed by "a + b;". Nee
I don't like mixing references with pointers. I don't find reference offering much more than raw pointers.
### RTTI and Exceptions
Totally useless for kernels.
Totally useless for bond.