Merging new cross-cc

This commit is contained in:
Adrien Bourmault 2020-06-02 09:46:13 +02:00
commit 114bdd2c10
No known key found for this signature in database
GPG Key ID: AFEE5788AEE3F4EC
9 changed files with 911 additions and 27 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ Makefile.out.2
build/bin/s**
.buildconfig
#.stylehlp
cross-cc*
# Linker output
*.ilk

View File

@ -23,7 +23,7 @@
#=----------------------------------------------------------------------------=#
2018-10-00 @os-k-team <os-k-team@os-k.eu>
Adrien Bourmault and Julian Barathie started talking about making their own OS
Adrien Bourmault and Julian Barathieu started talking about making their own OS
2018-11-00 @os-k-team <os-k-team@os-k.eu>
Name decided & creation of os-k.eu

View File

@ -22,7 +22,7 @@
# along with OS/K. If not, see <https://www.gnu.org/licenses/>. #
#=----------------------------------------------------------------------------=#
.PHONY: all test testnokvm testnosnd test32 debug gdb ddd gdbnokvm dddnokvm installonimage dust clean OS/K run
.PHONY: all test testnokvm testnosnd test32 debug gdb ddd gdbnokvm dddnokvm installonimage dust clean OS/K run update-cross-cc
.DELETE_ON_ERROR: $(BINDIR)/kaleid
.DEFAULT_GOAL := all
@ -33,6 +33,12 @@ mode ?= debug
ram ?= 4G
cpu ?= core2duo
# Cross-cc
CROSS-CC-DIR := $(shell pwd)/cross-cc
LATEST-CROSS-CC := https://gitlab.os-k.eu/os-k-team/cross-cc-builder/uploads/fcb43b0cc04c75ff89e40b4b24567484/cross-cc.tar.xz
export PATH := $(CROSS-CC-DIR)/bin:$(PATH)
NTHREADS := $(shell nproc)
# Programs
ASM=nasm
LD=x86_64-elf-ld
@ -45,7 +51,7 @@ LDFLAGS=-melf_x86_64
COPTIM=-O2
CWARNS=-Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Werror=implicit-function-declaration -Werror=return-type #-Wpadded
CINCLUDES=-Iinclude -Iinclude/drivers -Iinclude/kernel
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 -fstack-protector-all -fdump-rtl-expand
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 -fstack-protector-strong -fdump-rtl-expand
CFLAGS2= -c -mno-red-zone -mno-mmx -mno-sse -mno-sse2
CFLAGS= $(CFLAGS1) $(CFLAGS2)
CFLAGS_MATHS= $(CFLAGS1) -c -mno-red-zone -mno-mmx
@ -138,6 +144,12 @@ DriverDep=$(patsubst %.c,$(KOBJDIR)/%.d,$(DriverSources))
## MISC MAKEFILE ------------------------------------------------------------- #
$(CROSS-CC-DIR)/bin/x86_64-elf-gcc:
@echo ${CL2}[$@] ${NC} Downloading and extracting the cross-compiler...${CL3}
@wget $(LATEST-CROSS-CC) -O $(CROSS-CC-DIR).tar.xz -q -c --show-progress
@tar -xaf $(CROSS-CC-DIR).tar.xz --skip-old-files
@echo ${CL2}[$@] ${CL}Success.${CL3}
./ProjectTree: ./.stylehlp_sh
@cat ./.stylehlp_sh > ./ProjectTree
@echo "\n" >> ./ProjectTree
@ -242,7 +254,7 @@ $(KOBJDIR)/drivers/ata.o: $(KALEIDDIR)/drivers/ata.c $(KALEIDDIR)/drivers/ata.as
## DEPENDENCIES MAKEFILE ----------------------------------------------------- #
$(KOBJDIR)/%.d: %.c | $(KOBJDIR)
$(KOBJDIR)/%.d: %.c $(CROSS-CC-DIR)/bin/x86_64-elf-gcc | $(KOBJDIR)
@mkdir -p $(shell dirname $@)
@$(KCC) -MM -MT $(@:%.d=%.o) -MF $@ $<
@echo ${CL2}[$@] ${CL}Dependencies generated.${CL3}
@ -279,8 +291,8 @@ $(LOBJDIR)/loader.o: $(LOADERDIR)/loader.asm $(LOADERDIR)/*/*.inc
OS/K: $(dep) ./ProjectTree $(BINDIR)/kaleid
@echo ${CL2}[[$@]] ${NC} OS/K successfully made, $(mode) mode.${CL3}
all :
@make OS/K -j 8
all : $(CROSS-CC-DIR)/bin/x86_64-elf-gcc
@make OS/K -j $(NTHREADS)
## QEMU/DEBUG RELATED
test: all installonimage
@ -361,3 +373,7 @@ clean:
@rm -Rvf ./ProjectTree $(BUILDDIR)/*.log
@rm -Rvf $(BINDIR) $(OBJDIR)
@echo ${CL2}[$@] ${CL}Cleaned.${CL3}
update-cross-cc:
@rm -rf cross-cc
@echo ${CL2}[$@] ${CL}Ready to update.${CL3}

View File

@ -27,24 +27,802 @@
├── boot
│   ├── grub
│   │   └── grub.cfg
│   ├── loader
│   │   ├── cpu
│   │   │   ├── cpu32.inc
│   │   │   └── cpu.inc
│   │   ├── io
│   │   │   └── terminal.inc
│   │   ├── mem
│   │   │   ├── management.inc
│   │   │   └── structures.inc
│   │   ├── multiboot
│   │   │   ├── check.inc
│   │   │   └── header.inc
│   │   └── loader.asm
│   └── folder.desc
│   └── loader
│   ├── cpu
│   │   ├── cpu32.inc
│   │   └── cpu.inc
│   ├── io
│   │   └── terminal.inc
│   ├── mem
│   │   ├── management.inc
│   │   └── structures.inc
│   ├── multiboot
│   │   ├── check.inc
│   │   └── header.inc
│   └── loader.asm
├── build
│   ├── create_disk.sh
│   ├── install-os-k.sh
│   └── kernel.ld
├── cross-cc
│   ├── include
│   ├── lib
│   │   └── gcc
│   │   └── x86_64-elf
│   │   └── 10.1.0
│   │   ├── include
│   │   │   ├── adxintrin.h
│   │   │   ├── ammintrin.h
│   │   │   ├── avx2intrin.h
│   │   │   ├── avx5124fmapsintrin.h
│   │   │   ├── avx5124vnniwintrin.h
│   │   │   ├── avx512bf16intrin.h
│   │   │   ├── avx512bf16vlintrin.h
│   │   │   ├── avx512bitalgintrin.h
│   │   │   ├── avx512bwintrin.h
│   │   │   ├── avx512cdintrin.h
│   │   │   ├── avx512dqintrin.h
│   │   │   ├── avx512erintrin.h
│   │   │   ├── avx512fintrin.h
│   │   │   ├── avx512ifmaintrin.h
│   │   │   ├── avx512ifmavlintrin.h
│   │   │   ├── avx512pfintrin.h
│   │   │   ├── avx512vbmi2intrin.h
│   │   │   ├── avx512vbmi2vlintrin.h
│   │   │   ├── avx512vbmiintrin.h
│   │   │   ├── avx512vbmivlintrin.h
│   │   │   ├── avx512vlbwintrin.h
│   │   │   ├── avx512vldqintrin.h
│   │   │   ├── avx512vlintrin.h
│   │   │   ├── avx512vnniintrin.h
│   │   │   ├── avx512vnnivlintrin.h
│   │   │   ├── avx512vp2intersectintrin.h
│   │   │   ├── avx512vp2intersectvlintrin.h
│   │   │   ├── avx512vpopcntdqintrin.h
│   │   │   ├── avx512vpopcntdqvlintrin.h
│   │   │   ├── avxintrin.h
│   │   │   ├── bmi2intrin.h
│   │   │   ├── bmiintrin.h
│   │   │   ├── bmmintrin.h
│   │   │   ├── cet.h
│   │   │   ├── cetintrin.h
│   │   │   ├── cldemoteintrin.h
│   │   │   ├── clflushoptintrin.h
│   │   │   ├── clwbintrin.h
│   │   │   ├── clzerointrin.h
│   │   │   ├── cpuid.h
│   │   │   ├── cross-stdarg.h
│   │   │   ├── emmintrin.h
│   │   │   ├── enqcmdintrin.h
│   │   │   ├── f16cintrin.h
│   │   │   ├── float.h
│   │   │   ├── fma4intrin.h
│   │   │   ├── fmaintrin.h
│   │   │   ├── fxsrintrin.h
│   │   │   ├── gcov.h
│   │   │   ├── gfniintrin.h
│   │   │   ├── ia32intrin.h
│   │   │   ├── immintrin.h
│   │   │   ├── iso646.h
│   │   │   ├── lwpintrin.h
│   │   │   ├── lzcntintrin.h
│   │   │   ├── mm3dnow.h
│   │   │   ├── mmintrin.h
│   │   │   ├── mm_malloc.h
│   │   │   ├── movdirintrin.h
│   │   │   ├── mwaitxintrin.h
│   │   │   ├── nmmintrin.h
│   │   │   ├── pconfigintrin.h
│   │   │   ├── pkuintrin.h
│   │   │   ├── pmmintrin.h
│   │   │   ├── popcntintrin.h
│   │   │   ├── prfchwintrin.h
│   │   │   ├── rdseedintrin.h
│   │   │   ├── rtmintrin.h
│   │   │   ├── sgxintrin.h
│   │   │   ├── shaintrin.h
│   │   │   ├── smmintrin.h
│   │   │   ├── stdalign.h
│   │   │   ├── stdarg.h
│   │   │   ├── stdatomic.h
│   │   │   ├── stdbool.h
│   │   │   ├── stddef.h
│   │   │   ├── stdfix.h
│   │   │   ├── stdint-gcc.h
│   │   │   ├── stdint.h
│   │   │   ├── stdnoreturn.h
│   │   │   ├── tbmintrin.h
│   │   │   ├── tgmath.h
│   │   │   ├── tmmintrin.h
│   │   │   ├── unwind.h
│   │   │   ├── vaesintrin.h
│   │   │   ├── varargs.h
│   │   │   ├── vpclmulqdqintrin.h
│   │   │   ├── waitpkgintrin.h
│   │   │   ├── wbnoinvdintrin.h
│   │   │   ├── wmmintrin.h
│   │   │   ├── x86intrin.h
│   │   │   ├── xmmintrin.h
│   │   │   ├── xopintrin.h
│   │   │   ├── xsavecintrin.h
│   │   │   ├── xsaveintrin.h
│   │   │   ├── xsaveoptintrin.h
│   │   │   ├── xsavesintrin.h
│   │   │   └── xtestintrin.h
│   │   ├── include-fixed
│   │   │   ├── limits.h
│   │   │   ├── README
│   │   │   └── syslimits.h
│   │   ├── install-tools
│   │   │   ├── include
│   │   │   │   ├── limits.h
│   │   │   │   └── README
│   │   │   ├── fixinc_list
│   │   │   ├── gsyslimits.h
│   │   │   ├── macro_list
│   │   │   └── mkheaders.conf
│   │   ├── no-red-zone
│   │   │   ├── crtbegin.o
│   │   │   ├── crtend.o
│   │   │   ├── libgcc.a
│   │   │   └── libgcov.a
│   │   ├── plugin
│   │   │   ├── include
│   │   │   │   ├── ada
│   │   │   │   │   └── gcc-interface
│   │   │   │   │   └── ada-tree.def
│   │   │   │   ├── c-family
│   │   │   │   │   ├── c-common.def
│   │   │   │   │   ├── c-common.h
│   │   │   │   │   ├── c-objc.h
│   │   │   │   │   ├── c-pragma.h
│   │   │   │   │   └── c-pretty-print.h
│   │   │   │   ├── config
│   │   │   │   │   ├── i386
│   │   │   │   │   │   ├── att.h
│   │   │   │   │   │   ├── biarch64.h
│   │   │   │   │   │   ├── i386elf.h
│   │   │   │   │   │   ├── i386.h
│   │   │   │   │   │   ├── i386-opts.h
│   │   │   │   │   │   ├── i386-protos.h
│   │   │   │   │   │   ├── stringop.def
│   │   │   │   │   │   ├── unix.h
│   │   │   │   │   │   ├── x86-64.h
│   │   │   │   │   │   └── x86-tune.def
│   │   │   │   │   ├── dbxelf.h
│   │   │   │   │   ├── elfos.h
│   │   │   │   │   ├── initfini-array.h
│   │   │   │   │   ├── newlib-stdint.h
│   │   │   │   │   └── vxworks-dummy.h
│   │   │   │   ├── cp
│   │   │   │   │   ├── cp-tree.def
│   │   │   │   │   ├── cp-tree.h
│   │   │   │   │   ├── cxx-pretty-print.h
│   │   │   │   │   ├── name-lookup.h
│   │   │   │   │   ├── operators.def
│   │   │   │   │   └── type-utils.h
│   │   │   │   ├── d
│   │   │   │   │   └── d-tree.def
│   │   │   │   ├── objc
│   │   │   │   │   └── objc-tree.def
│   │   │   │   ├── addresses.h
│   │   │   │   ├── alias.h
│   │   │   │   ├── align.h
│   │   │   │   ├── alloc-pool.h
│   │   │   │   ├── all-tree.def
│   │   │   │   ├── ansidecl.h
│   │   │   │   ├── array-traits.h
│   │   │   │   ├── asan.h
│   │   │   │   ├── attribs.h
│   │   │   │   ├── auto-host.h
│   │   │   │   ├── auto-profile.h
│   │   │   │   ├── backend.h
│   │   │   │   ├── basic-block.h
│   │   │   │   ├── bb-reorder.h
│   │   │   │   ├── b-header-vars
│   │   │   │   ├── bitmap.h
│   │   │   │   ├── brig-builtins.def
│   │   │   │   ├── builtin-attrs.def
│   │   │   │   ├── builtins.def
│   │   │   │   ├── builtins.h
│   │   │   │   ├── builtin-types.def
│   │   │   │   ├── bversion.h
│   │   │   │   ├── calls.h
│   │   │   │   ├── ccmp.h
│   │   │   │   ├── cfganal.h
│   │   │   │   ├── cfgbuild.h
│   │   │   │   ├── cfgcleanup.h
│   │   │   │   ├── cfgexpand.h
│   │   │   │   ├── cfg-flags.def
│   │   │   │   ├── cfg.h
│   │   │   │   ├── cfghooks.h
│   │   │   │   ├── cfgloop.h
│   │   │   │   ├── cfgloopmanip.h
│   │   │   │   ├── cfgrtl.h
│   │   │   │   ├── cgraph.h
│   │   │   │   ├── cif-code.def
│   │   │   │   ├── collect2-aix.h
│   │   │   │   ├── collect2.h
│   │   │   │   ├── collect-utils.h
│   │   │   │   ├── color-macros.h
│   │   │   │   ├── conditions.h
│   │   │   │   ├── configargs.h
│   │   │   │   ├── config.h
│   │   │   │   ├── context.h
│   │   │   │   ├── convert.h
│   │   │   │   ├── coretypes.h
│   │   │   │   ├── coroutine-builtins.def
│   │   │   │   ├── coverage.h
│   │   │   │   ├── cppbuiltin.h
│   │   │   │   ├── cppdefault.h
│   │   │   │   ├── cpplib.h
│   │   │   │   ├── cselib.h
│   │   │   │   ├── c-tree.h
│   │   │   │   ├── data-streamer.h
│   │   │   │   ├── dbgcnt.def
│   │   │   │   ├── dbgcnt.h
│   │   │   │   ├── dbxout.h
│   │   │   │   ├── dce.h
│   │   │   │   ├── ddg.h
│   │   │   │   ├── debug.h
│   │   │   │   ├── defaults.h
│   │   │   │   ├── df.h
│   │   │   │   ├── dfp.h
│   │   │   │   ├── diagnostic-color.h
│   │   │   │   ├── diagnostic-core.h
│   │   │   │   ├── diagnostic.def
│   │   │   │   ├── diagnostic-event-id.h
│   │   │   │   ├── diagnostic.h
│   │   │   │   ├── diagnostic-metadata.h
│   │   │   │   ├── diagnostic-path.h
│   │   │   │   ├── diagnostic-url.h
│   │   │   │   ├── digraph.h
│   │   │   │   ├── dojump.h
│   │   │   │   ├── dominance.h
│   │   │   │   ├── domwalk.h
│   │   │   │   ├── double-int.h
│   │   │   │   ├── dump-context.h
│   │   │   │   ├── dumpfile.h
│   │   │   │   ├── dwarf2asm.h
│   │   │   │   ├── dwarf2out.h
│   │   │   │   ├── edit-context.h
│   │   │   │   ├── emit-rtl.h
│   │   │   │   ├── errors.h
│   │   │   │   ├── escaped_string.h
│   │   │   │   ├── et-forest.h
│   │   │   │   ├── except.h
│   │   │   │   ├── explow.h
│   │   │   │   ├── expmed.h
│   │   │   │   ├── expr.h
│   │   │   │   ├── fibonacci_heap.h
│   │   │   │   ├── file-find.h
│   │   │   │   ├── filenames.h
│   │   │   │   ├── file-prefix-map.h
│   │   │   │   ├── fixed-value.h
│   │   │   │   ├── flags.h
│   │   │   │   ├── flag-types.h
│   │   │   │   ├── fold-const-call.h
│   │   │   │   ├── fold-const.h
│   │   │   │   ├── function-abi.h
│   │   │   │   ├── function.h
│   │   │   │   ├── gcc.h
│   │   │   │   ├── gcc-plugin.h
│   │   │   │   ├── gcc-rich-location.h
│   │   │   │   ├── gcc-symtab.h
│   │   │   │   ├── gcov-counter.def
│   │   │   │   ├── gcov-io.h
│   │   │   │   ├── gcse-common.h
│   │   │   │   ├── gcse.h
│   │   │   │   ├── generic-match.h
│   │   │   │   ├── gengtype.h
│   │   │   │   ├── genrtl.h
│   │   │   │   ├── gensupport.h
│   │   │   │   ├── ggc.h
│   │   │   │   ├── ggc-internal.h
│   │   │   │   ├── gimple-builder.h
│   │   │   │   ├── gimple.def
│   │   │   │   ├── gimple-expr.h
│   │   │   │   ├── gimple-fold.h
│   │   │   │   ├── gimple.h
│   │   │   │   ├── gimple-iterator.h
│   │   │   │   ├── gimple-low.h
│   │   │   │   ├── gimple-match.h
│   │   │   │   ├── gimple-predict.h
│   │   │   │   ├── gimple-pretty-print.h
│   │   │   │   ├── gimple-ssa-evrp-analyze.h
│   │   │   │   ├── gimple-ssa.h
│   │   │   │   ├── gimple-ssa-warn-restrict.h
│   │   │   │   ├── gimple-streamer.h
│   │   │   │   ├── gimple-walk.h
│   │   │   │   ├── gimplify.h
│   │   │   │   ├── gimplify-me.h
│   │   │   │   ├── glimits.h
│   │   │   │   ├── graphds.h
│   │   │   │   ├── graph.h
│   │   │   │   ├── graphite.h
│   │   │   │   ├── graphviz.h
│   │   │   │   ├── gsstruct.def
│   │   │   │   ├── gstab.h
│   │   │   │   ├── gsyms.h
│   │   │   │   ├── gsyslimits.h
│   │   │   │   ├── gtm-builtins.def
│   │   │   │   ├── gtype-desc.h
│   │   │   │   ├── hard-reg-set.h
│   │   │   │   ├── hash-map.h
│   │   │   │   ├── hash-map-traits.h
│   │   │   │   ├── hash-set.h
│   │   │   │   ├── hashtab.h
│   │   │   │   ├── hash-table.h
│   │   │   │   ├── hash-traits.h
│   │   │   │   ├── highlev-plugin-common.h
│   │   │   │   ├── hooks.h
│   │   │   │   ├── hosthooks-def.h
│   │   │   │   ├── hosthooks.h
│   │   │   │   ├── hsa-brig-format.h
│   │   │   │   ├── hsa-builtins.def
│   │   │   │   ├── hsa-common.h
│   │   │   │   ├── hw-doloop.h
│   │   │   │   ├── hwint.h
│   │   │   │   ├── ifcvt.h
│   │   │   │   ├── inchash.h
│   │   │   │   ├── incpath.h
│   │   │   │   ├── input.h
│   │   │   │   ├── insn-addr.h
│   │   │   │   ├── insn-attr-common.h
│   │   │   │   ├── insn-attr.h
│   │   │   │   ├── insn-codes.h
│   │   │   │   ├── insn-constants.h
│   │   │   │   ├── insn-flags.h
│   │   │   │   ├── insn-modes.h
│   │   │   │   ├── insn-modes-inline.h
│   │   │   │   ├── insn-notes.def
│   │   │   │   ├── internal-fn.def
│   │   │   │   ├── internal-fn.h
│   │   │   │   ├── intl.h
│   │   │   │   ├── int-vector-builder.h
│   │   │   │   ├── ipa-fnsummary.h
│   │   │   │   ├── ipa-icf-gimple.h
│   │   │   │   ├── ipa-icf.h
│   │   │   │   ├── ipa-inline.h
│   │   │   │   ├── ipa-param-manipulation.h
│   │   │   │   ├── ipa-predicate.h
│   │   │   │   ├── ipa-prop.h
│   │   │   │   ├── ipa-reference.h
│   │   │   │   ├── ipa-ref.h
│   │   │   │   ├── ipa-utils.h
│   │   │   │   ├── ira.h
│   │   │   │   ├── ira-int.h
│   │   │   │   ├── is-a.h
│   │   │   │   ├── json.h
│   │   │   │   ├── langhooks-def.h
│   │   │   │   ├── langhooks.h
│   │   │   │   ├── lcm.h
│   │   │   │   ├── libfuncs.h
│   │   │   │   ├── libiberty.h
│   │   │   │   ├── limitx.h
│   │   │   │   ├── limity.h
│   │   │   │   ├── line-map.h
│   │   │   │   ├── loop-unroll.h
│   │   │   │   ├── lower-subreg.h
│   │   │   │   ├── lra.h
│   │   │   │   ├── lra-int.h
│   │   │   │   ├── lto-compress.h
│   │   │   │   ├── lto-section-names.h
│   │   │   │   ├── lto-streamer.h
│   │   │   │   ├── machmode.def
│   │   │   │   ├── machmode.h
│   │   │   │   ├── md5.h
│   │   │   │   ├── memmodel.h
│   │   │   │   ├── memory-block.h
│   │   │   │   ├── mem-stats.h
│   │   │   │   ├── mem-stats-traits.h
│   │   │   │   ├── mode-classes.def
│   │   │   │   ├── obstack.h
│   │   │   │   ├── omp-builtins.def
│   │   │   │   ├── omp-expand.h
│   │   │   │   ├── omp-general.h
│   │   │   │   ├── omp-grid.h
│   │   │   │   ├── omp-low.h
│   │   │   │   ├── omp-offload.h
│   │   │   │   ├── omp-simd-clone.h
│   │   │   │   ├── optabs.def
│   │   │   │   ├── optabs.h
│   │   │   │   ├── optabs-libfuncs.h
│   │   │   │   ├── optabs-query.h
│   │   │   │   ├── optabs-tree.h
│   │   │   │   ├── optinfo-emit-json.h
│   │   │   │   ├── optinfo.h
│   │   │   │   ├── options.h
│   │   │   │   ├── opt-problem.h
│   │   │   │   ├── opts-diagnostic.h
│   │   │   │   ├── opts.h
│   │   │   │   ├── opt-suggestions.h
│   │   │   │   ├── ordered-hash-map.h
│   │   │   │   ├── output.h
│   │   │   │   ├── passes.def
│   │   │   │   ├── pass-instances.def
│   │   │   │   ├── pass_manager.h
│   │   │   │   ├── plugin-api.h
│   │   │   │   ├── plugin.def
│   │   │   │   ├── plugin.h
│   │   │   │   ├── plugin-version.h
│   │   │   │   ├── poly-int.h
│   │   │   │   ├── poly-int-types.h
│   │   │   │   ├── predict.def
│   │   │   │   ├── predict.h
│   │   │   │   ├── prefix.h
│   │   │   │   ├── pretty-print.h
│   │   │   │   ├── print-rtl.h
│   │   │   │   ├── print-tree.h
│   │   │   │   ├── profile-count.h
│   │   │   │   ├── profile.h
│   │   │   │   ├── range.h
│   │   │   │   ├── range-op.h
│   │   │   │   ├── read-md.h
│   │   │   │   ├── read-rtl-function.h
│   │   │   │   ├── real.h
│   │   │   │   ├── realmpfr.h
│   │   │   │   ├── recog.h
│   │   │   │   ├── regcprop.h
│   │   │   │   ├── reg-notes.def
│   │   │   │   ├── regrename.h
│   │   │   │   ├── regset.h
│   │   │   │   ├── regs.h
│   │   │   │   ├── reload.h
│   │   │   │   ├── resource.h
│   │   │   │   ├── rtl.def
│   │   │   │   ├── rtl-error.h
│   │   │   │   ├── rtl.h
│   │   │   │   ├── rtlhash.h
│   │   │   │   ├── rtlhooks-def.h
│   │   │   │   ├── rtl-iter.h
│   │   │   │   ├── rtx-vector-builder.h
│   │   │   │   ├── run-rtl-passes.h
│   │   │   │   ├── safe-ctype.h
│   │   │   │   ├── sanitizer.def
│   │   │   │   ├── sbitmap.h
│   │   │   │   ├── sched-int.h
│   │   │   │   ├── selftest-diagnostic.h
│   │   │   │   ├── selftest.h
│   │   │   │   ├── selftest-rtl.h
│   │   │   │   ├── sel-sched-dump.h
│   │   │   │   ├── sel-sched.h
│   │   │   │   ├── sel-sched-ir.h
│   │   │   │   ├── sese.h
│   │   │   │   ├── shortest-paths.h
│   │   │   │   ├── shrink-wrap.h
│   │   │   │   ├── signop.h
│   │   │   │   ├── sparseset.h
│   │   │   │   ├── spellcheck.h
│   │   │   │   ├── spellcheck-tree.h
│   │   │   │   ├── splay-tree.h
│   │   │   │   ├── sreal.h
│   │   │   │   ├── ssa.h
│   │   │   │   ├── ssa-iterators.h
│   │   │   │   ├── stab.def
│   │   │   │   ├── statistics.h
│   │   │   │   ├── stmt.h
│   │   │   │   ├── stor-layout.h
│   │   │   │   ├── streamer-hooks.h
│   │   │   │   ├── stringpool.h
│   │   │   │   ├── substring-locations.h
│   │   │   │   ├── symbol-summary.h
│   │   │   │   ├── symtab.h
│   │   │   │   ├── sync-builtins.def
│   │   │   │   ├── system.h
│   │   │   │   ├── target.def
│   │   │   │   ├── target-def.h
│   │   │   │   ├── target-globals.h
│   │   │   │   ├── target.h
│   │   │   │   ├── target-hooks-macros.h
│   │   │   │   ├── target-insns.def
│   │   │   │   ├── targhooks.h
│   │   │   │   ├── timevar.def
│   │   │   │   ├── timevar.h
│   │   │   │   ├── tm.h
│   │   │   │   ├── tm_p.h
│   │   │   │   ├── tm-preds.h
│   │   │   │   ├── toplev.h
│   │   │   │   ├── tracer.h
│   │   │   │   ├── trans-mem.h
│   │   │   │   ├── tree-affine.h
│   │   │   │   ├── tree-cfgcleanup.h
│   │   │   │   ├── tree-cfg.h
│   │   │   │   ├── tree-check.h
│   │   │   │   ├── tree-chrec.h
│   │   │   │   ├── tree-core.h
│   │   │   │   ├── tree-data-ref.h
│   │   │   │   ├── tree.def
│   │   │   │   ├── tree-dfa.h
│   │   │   │   ├── tree-diagnostic.h
│   │   │   │   ├── tree-dump.h
│   │   │   │   ├── tree-eh.h
│   │   │   │   ├── tree.h
│   │   │   │   ├── tree-hasher.h
│   │   │   │   ├── tree-hash-traits.h
│   │   │   │   ├── tree-if-conv.h
│   │   │   │   ├── tree-inline.h
│   │   │   │   ├── tree-into-ssa.h
│   │   │   │   ├── tree-iterator.h
│   │   │   │   ├── tree-nested.h
│   │   │   │   ├── tree-object-size.h
│   │   │   │   ├── tree-outof-ssa.h
│   │   │   │   ├── tree-parloops.h
│   │   │   │   ├── tree-pass.h
│   │   │   │   ├── tree-phinodes.h
│   │   │   │   ├── tree-pretty-print.h
│   │   │   │   ├── tree-scalar-evolution.h
│   │   │   │   ├── tree-sra.h
│   │   │   │   ├── tree-ssa-address.h
│   │   │   │   ├── tree-ssa-alias.h
│   │   │   │   ├── tree-ssa-ccp.h
│   │   │   │   ├── tree-ssa-coalesce.h
│   │   │   │   ├── tree-ssa-dce.h
│   │   │   │   ├── tree-ssa-dom.h
│   │   │   │   ├── tree-ssa-dse.h
│   │   │   │   ├── tree-ssa.h
│   │   │   │   ├── tree-ssa-live.h
│   │   │   │   ├── tree-ssa-loop.h
│   │   │   │   ├── tree-ssa-loop-ivopts.h
│   │   │   │   ├── tree-ssa-loop-manip.h
│   │   │   │   ├── tree-ssa-loop-niter.h
│   │   │   │   ├── tree-ssanames.h
│   │   │   │   ├── tree-ssa-operands.h
│   │   │   │   ├── tree-ssa-propagate.h
│   │   │   │   ├── tree-ssa-sccvn.h
│   │   │   │   ├── tree-ssa-scopedtables.h
│   │   │   │   ├── tree-ssa-strlen.h
│   │   │   │   ├── tree-ssa-ter.h
│   │   │   │   ├── tree-ssa-threadedge.h
│   │   │   │   ├── tree-ssa-threadupdate.h
│   │   │   │   ├── tree-stdarg.h
│   │   │   │   ├── tree-streamer.h
│   │   │   │   ├── treestruct.def
│   │   │   │   ├── tree-switch-conversion.h
│   │   │   │   ├── tree-vector-builder.h
│   │   │   │   ├── tree-vectorizer.h
│   │   │   │   ├── tree-vrp.h
│   │   │   │   ├── tristate.h
│   │   │   │   ├── tsan.h
│   │   │   │   ├── tsystem.h
│   │   │   │   ├── typeclass.h
│   │   │   │   ├── typed-splay-tree.h
│   │   │   │   ├── ubsan.h
│   │   │   │   ├── valtrack.h
│   │   │   │   ├── value-prof.h
│   │   │   │   ├── value-range.h
│   │   │   │   ├── varasm.h
│   │   │   │   ├── vec.h
│   │   │   │   ├── vec-perm-indices.h
│   │   │   │   ├── vector-builder.h
│   │   │   │   ├── version.h
│   │   │   │   ├── vmsdbg.h
│   │   │   │   ├── vr-values.h
│   │   │   │   ├── vtable-verify.h
│   │   │   │   ├── wide-int-bitmask.h
│   │   │   │   ├── wide-int.h
│   │   │   │   ├── wide-int-print.h
│   │   │   │   ├── xcoff.h
│   │   │   │   └── xcoffout.h
│   │   │   └── gtype.state
│   │   ├── crtbegin.o
│   │   ├── crtend.o
│   │   ├── libgcc.a
│   │   └── libgcov.a
│   ├── libexec
│   │   └── gcc
│   │   └── x86_64-elf
│   │   └── 10.1.0
│   │   ├── install-tools
│   │   │   ├── fixincl
│   │   │   ├── fixinc.sh
│   │   │   ├── mkheaders
│   │   │   └── mkinstalldirs
│   │   ├── plugin
│   │   │   └── gengtype
│   │   ├── cc1
│   │   ├── cc1plus
│   │   ├── collect2
│   │   ├── liblto_plugin.la
│   │   ├── liblto_plugin.so -> liblto_plugin.so.0.0.0
│   │   ├── liblto_plugin.so.0 -> liblto_plugin.so.0.0.0
│   │   ├── liblto_plugin.so.0.0.0
│   │   ├── lto1
│   │   └── lto-wrapper
│   ├── share
│   │   ├── info
│   │   │   ├── as.info
│   │   │   ├── bfd.info
│   │   │   ├── binutils.info
│   │   │   ├── cpp.info
│   │   │   ├── cppinternals.info
│   │   │   ├── dir
│   │   │   ├── gcc.info
│   │   │   ├── gccinstall.info
│   │   │   ├── gccint.info
│   │   │   ├── gprof.info
│   │   │   └── ld.info
│   │   └── man
│   │   ├── man1
│   │   │   ├── x86_64-elf-addr2line.1
│   │   │   ├── x86_64-elf-ar.1
│   │   │   ├── x86_64-elf-as.1
│   │   │   ├── x86_64-elf-c++filt.1
│   │   │   ├── x86_64-elf-cpp.1
│   │   │   ├── x86_64-elf-dlltool.1
│   │   │   ├── x86_64-elf-elfedit.1
│   │   │   ├── x86_64-elf-g++.1
│   │   │   ├── x86_64-elf-gcc.1
│   │   │   ├── x86_64-elf-gcov.1
│   │   │   ├── x86_64-elf-gcov-dump.1
│   │   │   ├── x86_64-elf-gcov-tool.1
│   │   │   ├── x86_64-elf-gprof.1
│   │   │   ├── x86_64-elf-ld.1
│   │   │   ├── x86_64-elf-lto-dump.1
│   │   │   ├── x86_64-elf-nm.1
│   │   │   ├── x86_64-elf-objcopy.1
│   │   │   ├── x86_64-elf-objdump.1
│   │   │   ├── x86_64-elf-ranlib.1
│   │   │   ├── x86_64-elf-readelf.1
│   │   │   ├── x86_64-elf-size.1
│   │   │   ├── x86_64-elf-strings.1
│   │   │   ├── x86_64-elf-strip.1
│   │   │   ├── x86_64-elf-windmc.1
│   │   │   └── x86_64-elf-windres.1
│   │   └── man7
│   │   ├── fsf-funding.7
│   │   ├── gfdl.7
│   │   └── gpl.7
│   └── x86_64-elf
│   └── lib
│   └── ldscripts
│   ├── elf32_x86_64.x
│   ├── elf32_x86_64.xbn
│   ├── elf32_x86_64.xc
│   ├── elf32_x86_64.xce
│   ├── elf32_x86_64.xd
│   ├── elf32_x86_64.xdc
│   ├── elf32_x86_64.xdce
│   ├── elf32_x86_64.xde
│   ├── elf32_x86_64.xdw
│   ├── elf32_x86_64.xdwe
│   ├── elf32_x86_64.xe
│   ├── elf32_x86_64.xn
│   ├── elf32_x86_64.xr
│   ├── elf32_x86_64.xs
│   ├── elf32_x86_64.xsc
│   ├── elf32_x86_64.xsce
│   ├── elf32_x86_64.xse
│   ├── elf32_x86_64.xsw
│   ├── elf32_x86_64.xswe
│   ├── elf32_x86_64.xu
│   ├── elf32_x86_64.xw
│   ├── elf32_x86_64.xwe
│   ├── elf_i386.x
│   ├── elf_i386.xbn
│   ├── elf_i386.xc
│   ├── elf_i386.xce
│   ├── elf_i386.xd
│   ├── elf_i386.xdc
│   ├── elf_i386.xdce
│   ├── elf_i386.xde
│   ├── elf_i386.xdw
│   ├── elf_i386.xdwe
│   ├── elf_i386.xe
│   ├── elf_i386.xn
│   ├── elf_i386.xr
│   ├── elf_i386.xs
│   ├── elf_i386.xsc
│   ├── elf_i386.xsce
│   ├── elf_i386.xse
│   ├── elf_i386.xsw
│   ├── elf_i386.xswe
│   ├── elf_i386.xu
│   ├── elf_i386.xw
│   ├── elf_i386.xwe
│   ├── elf_iamcu.x
│   ├── elf_iamcu.xbn
│   ├── elf_iamcu.xc
│   ├── elf_iamcu.xce
│   ├── elf_iamcu.xd
│   ├── elf_iamcu.xdc
│   ├── elf_iamcu.xdce
│   ├── elf_iamcu.xde
│   ├── elf_iamcu.xdw
│   ├── elf_iamcu.xdwe
│   ├── elf_iamcu.xe
│   ├── elf_iamcu.xn
│   ├── elf_iamcu.xr
│   ├── elf_iamcu.xs
│   ├── elf_iamcu.xsc
│   ├── elf_iamcu.xsce
│   ├── elf_iamcu.xse
│   ├── elf_iamcu.xsw
│   ├── elf_iamcu.xswe
│   ├── elf_iamcu.xu
│   ├── elf_iamcu.xw
│   ├── elf_iamcu.xwe
│   ├── elf_k1om.x
│   ├── elf_k1om.xbn
│   ├── elf_k1om.xc
│   ├── elf_k1om.xce
│   ├── elf_k1om.xd
│   ├── elf_k1om.xdc
│   ├── elf_k1om.xdce
│   ├── elf_k1om.xde
│   ├── elf_k1om.xdw
│   ├── elf_k1om.xdwe
│   ├── elf_k1om.xe
│   ├── elf_k1om.xn
│   ├── elf_k1om.xr
│   ├── elf_k1om.xs
│   ├── elf_k1om.xsc
│   ├── elf_k1om.xsce
│   ├── elf_k1om.xse
│   ├── elf_k1om.xsw
│   ├── elf_k1om.xswe
│   ├── elf_k1om.xu
│   ├── elf_k1om.xw
│   ├── elf_k1om.xwe
│   ├── elf_l1om.x
│   ├── elf_l1om.xbn
│   ├── elf_l1om.xc
│   ├── elf_l1om.xce
│   ├── elf_l1om.xd
│   ├── elf_l1om.xdc
│   ├── elf_l1om.xdce
│   ├── elf_l1om.xde
│   ├── elf_l1om.xdw
│   ├── elf_l1om.xdwe
│   ├── elf_l1om.xe
│   ├── elf_l1om.xn
│   ├── elf_l1om.xr
│   ├── elf_l1om.xs
│   ├── elf_l1om.xsc
│   ├── elf_l1om.xsce
│   ├── elf_l1om.xse
│   ├── elf_l1om.xsw
│   ├── elf_l1om.xswe
│   ├── elf_l1om.xu
│   ├── elf_l1om.xw
│   ├── elf_l1om.xwe
│   ├── elf_x86_64.x
│   ├── elf_x86_64.xbn
│   ├── elf_x86_64.xc
│   ├── elf_x86_64.xce
│   ├── elf_x86_64.xd
│   ├── elf_x86_64.xdc
│   ├── elf_x86_64.xdce
│   ├── elf_x86_64.xde
│   ├── elf_x86_64.xdw
│   ├── elf_x86_64.xdwe
│   ├── elf_x86_64.xe
│   ├── elf_x86_64.xn
│   ├── elf_x86_64.xr
│   ├── elf_x86_64.xs
│   ├── elf_x86_64.xsc
│   ├── elf_x86_64.xsce
│   ├── elf_x86_64.xse
│   ├── elf_x86_64.xsw
│   ├── elf_x86_64.xswe
│   ├── elf_x86_64.xu
│   ├── elf_x86_64.xw
│   └── elf_x86_64.xwe
├── docs
│   ├── boot
│   │   ├── grub
│   │   │   └── grub.desc
│   │   └── loader
│   │   ├── cpu
│   │   ├── io
│   │   └── loader.desc
│   ├── kaleid
│   │   ├── drivers
│   │   ├── kernel
│   │   ├── libbuf
│   │   └── libc
│   ├── COPYING.GFDL
│   └── Documentation
├── include
│   ├── drivers
│   │   └── ata.h
@ -161,8 +939,10 @@
├── AUTHORS
├── ChangeLog
├── COPYING
├── cross-cc.tar.xz
├── Makefile
├── ProjectTree
└── README.md
30 directories, 110 files
74 directories, 845 files

View File

@ -23,13 +23,13 @@ apt update && apt upgrade
apt install grub-pc-bin dosfstools make nasm qemu tree libisl15 parted udisks2
```
You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) and its ``bin`` directory in your PATH.
To compile, simply use at the root of this project :
```
make
```
The OS/K cross-compiler will automatically be installed.
To compile and test, simply use at the root of this project :
```
make test

View File

@ -12,7 +12,17 @@
# Foundation; with no Invariant Sections, no Front-Cover Texts, and #
# no Back-Cover Texts. A copy of the license is included in the #
# file entitled "COPYING.GFDL" #
#=-----------------------------------------------------------------------------#
#=----------------------------------------------------------------------------=#
WIP
This folder contains the GRUB configuration file, `boot/grub/grub.cfg`,
used by GRUB to know which OS to boot and how to boot it.
The GRUB configuration is pretty simple. We choose to use a 0 timeout, a
single entry that starts OS/K.
Because OS/K is a multiboot compliant kernel, we launch it with the multiboot
command.
For instance, we ask vbe and vga modules to be provided, but OS/K doesn't use
these modules.

51
docs/boot/loader/cpu Normal file
View File

@ -0,0 +1,51 @@
#=----------------------------------------------------------------------------=#
# GNU GPL OS/K Documentation #
# #
# Desc: OS/K Loader : CPU Management functions #
# #
# #
# Copyright © 2018-2020 The OS/K Team #
# #
# Permission is granted to copy, distribute and/or modify this #
# document under the terms of the GNU Free Documentation License, #
# Version 1.3 or any later version published by the Free Software #
# Foundation; with no Invariant Sections, no Front-Cover Texts, and #
# no Back-Cover Texts. A copy of the license is included in the #
# file entitled "COPYING.GFDL" #
#=----------------------------------------------------------------------------=#
This folder contains two files, `boot/loader/cpu/cpu.inc` and
boot/loader/cpu/cpu32.inc`.
The `boot/loader/cpu/cpu32.inc` is intented to provide 32 bits protected mode
function that can control wether the CPU is qualified to run the OS/K code.
The `boot/loader/cpu/cpu3.inc` provides 64 bits long mode temporization function
used by the loader when necessary.
There is two functions in `cpu32.inc` :
- Is64Bits(), intented to check if the CPU is "ok" with 64 bit code,
if it supports long mode and will not burn if we ask it to execute OS/K
(i.e trigger a #UD fault).
For this check, we use first the 0x80000000 function of the CPUID instruction
that returns the highest CPUID function available. It must return at least
0x80000001, otherwise we can't check the long mode presence and it is most
likely absent. We pass the function number in the eax register.
As soon as 0x80000001 is available, we use it and verify it flips to 1 the bit
29 in edx.
- Check_cpuid(), that check if the CPUID instruction is supported by the CPU
before use it (don't want #UD).
For this, we use the FLAGS register and check if we can flip (overwrite with
a 1 persistantly) the bit 21. If it is possible, then CPUID is supported.
The temporize(), bitemporize() and tritemporize() functions in `cpu.inc`
are juste loops that make the cpu busy to wait. These temporization are not
precise at all, and are not intented to wait for a determined time lapse.

22
docs/boot/loader/io Normal file
View File

@ -0,0 +1,22 @@
#=----------------------------------------------------------------------------=#
# GNU GPL OS/K Documentation #
# #
# Desc: OS/K Loader : IO basic functions #
# #
# #
# Copyright © 2018-2020 The OS/K Team #
# #
# Permission is granted to copy, distribute and/or modify this #
# document under the terms of the GNU Free Documentation License, #
# Version 1.3 or any later version published by the Free Software #
# Foundation; with no Invariant Sections, no Front-Cover Texts, and #
# no Back-Cover Texts. A copy of the license is included in the #
# file entitled "COPYING.GFDL" #
#=----------------------------------------------------------------------------=#
This folder contains the basic drivers needed to boot OS/K.
There is one single file in this directory : `boot/loader/io/terminal.inc`
This file provides a basic way to print colored text to the screen, without
advanced functions, for both 32 and 64 bits modes.

View File

@ -12,7 +12,7 @@
# Foundation; with no Invariant Sections, no Front-Cover Texts, and #
# no Back-Cover Texts. A copy of the license is included in the #
# file entitled "COPYING.GFDL" #
#=-----------------------------------------------------------------------------#
#=----------------------------------------------------------------------------=#
This folder contains the source for OS/K's early loader.
@ -30,4 +30,8 @@ specified address and prepare it for the hard work it have to do :
- Send a structure for it with memory map, cpu infos, and other devices
infos, prepared by GRUB.
- Switch into long mode.
- Jump to Kaleid kernel.
- Jump to Kaleid kernel.
Our loader contains the multiboot header used by GRUB to check if the kernel
can be started with the multiboot method. We use an ELF multiboot format, because
it is more convenient.