├── sbin ├── Makefile.am └── service │ ├── Makefile.am │ └── main.c ├── sys ├── i686 │ ├── pmap.c │ ├── Makefrag.am │ ├── pmap.h │ ├── unpaged_init.c │ ├── kernel.lds │ └── boot.S ├── aarch64 │ ├── Makefrag.am │ └── boot.S ├── amd64 │ ├── Makefrag.am │ ├── boot.S │ └── kernel.lds ├── arm │ ├── Makefrag.am │ ├── linker.ld │ └── boot.S ├── riscv │ ├── Makefrag.am │ ├── pmap.h │ ├── kernel.lds │ ├── trap.c │ ├── boot.S │ ├── asm.h │ ├── vector.S │ └── sbi.h ├── version.c ├── include │ └── fukuro │ │ ├── spinlock.h │ │ └── kinfo.h ├── configfrag.ac ├── Makefile.am ├── vm │ ├── vm.h │ └── pmap.h ├── main.c └── sys │ └── multiboot.h ├── srv ├── vfs │ ├── Makefile.am │ └── main.c ├── fdos-src │ ├── Makefrag.am │ └── main.c ├── configfrag.ac ├── Makefile.am └── random │ └── main.c ├── Makefile.am ├── codecov.yml ├── .github ├── logo.ico ├── logo.png ├── screen │ └── fukuro_vbox.png ├── workflows │ ├── doc.yml │ ├── codeql-analysis.yml │ └── ci.yml └── logo.svg ├── bootstrap.sh ├── test ├── Kconfig ├── build.mk ├── test.c ├── strlen_test.c ├── strrev_test.c ├── memset_test.c └── itoa_test.c ├── lib ├── Makefile.am ├── minilibc │ ├── i686 │ │ └── crt0.S │ ├── amd64 │ │ ├── linker.ld │ │ └── crt0.S │ ├── riscv │ │ ├── linker.ld │ │ └── crt0.S │ ├── minilibc.c │ ├── arm │ │ └── crt0.S │ └── string.h └── csu │ ├── i686 │ └── crt0.S │ ├── amd64 │ ├── linker.ld │ └── crt0.S │ ├── riscv │ ├── linker.ld │ └── crt0.S │ └── arm │ └── crt0.S ├── .editorconfig ├── compile_flags.txt ├── .gitignore ├── docs ├── layout.md ├── theme │ ├── footer.html │ ├── header.html │ └── doxygen-awesome-darkmode-toggle.js └── credits.md ├── tools ├── format.sh └── setup-toolchain ├── CITATION.cff ├── README.md ├── configure.ac ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE └── LICENSE.GPL3 /sbin/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/i686/pmap.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /srv/vfs/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sys/aarch64/Makefrag.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sbin/service/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = lib sys srv 2 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "test" 3 | -------------------------------------------------------------------------------- /sys/amd64/Makefrag.am: -------------------------------------------------------------------------------- 1 | fukuro_SOURCES += \ 2 | amd64/boot.S 3 | -------------------------------------------------------------------------------- /sys/arm/Makefrag.am: -------------------------------------------------------------------------------- 1 | fukuro_SOURCES += \ 2 | arm/boot.S 3 | -------------------------------------------------------------------------------- /.github/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d0p1s4m4/Fukuro/HEAD/.github/logo.ico -------------------------------------------------------------------------------- /.github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d0p1s4m4/Fukuro/HEAD/.github/logo.png -------------------------------------------------------------------------------- /sys/i686/Makefrag.am: -------------------------------------------------------------------------------- 1 | fukuro_SOURCES += \ 2 | i686/boot.S \ 3 | i686/unpaged_init.c 4 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | main() { 4 | autoreconf -i -f 5 | } 6 | 7 | main "$@" 8 | -------------------------------------------------------------------------------- /srv/fdos-src/Makefrag.am: -------------------------------------------------------------------------------- 1 | fdos_SOURCES = \ 2 | fdos-src/main.c 3 | 4 | exec_server_PROGRAMS += fdos -------------------------------------------------------------------------------- /sys/amd64/boot.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .globl _entry 3 | .type _entry, @function 4 | _entry: 5 | ret 6 | -------------------------------------------------------------------------------- /.github/screen/fukuro_vbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/d0p1s4m4/Fukuro/HEAD/.github/screen/fukuro_vbox.png -------------------------------------------------------------------------------- /sys/riscv/Makefrag.am: -------------------------------------------------------------------------------- 1 | fukuro_SOURCES += \ 2 | riscv/boot.S \ 3 | riscv/trap.c \ 4 | riscv/vector.S -------------------------------------------------------------------------------- /test/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Test" 2 | 3 | config WITH_COVERAGE 4 | bool "With code coverage" 5 | default y 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /sys/version.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | const char *fukuro_version = PACKAGE_STRING " - built on " __DATE__ " " __TIME__ "\n"; 4 | -------------------------------------------------------------------------------- /lib/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_DATA = crt0.o 2 | 3 | crt0.o: minilibc/@systype@/crt0.S 4 | $(CC) -c $(AM_CPPFLAGS) $(CFLAGS) -o $@ $^ 5 | -------------------------------------------------------------------------------- /srv/configfrag.ac: -------------------------------------------------------------------------------- 1 | AC_ARG_ENABLE([fdos], 2 | AS_HELP_STRING([--enable-fdos], [Build Fukuro DOS])) 3 | AM_CONDITIONAL([ENABLE_FDOS], [test x"$enable_fdos" = xyes]) 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | end_of_line = lf 3 | insert_final_newline = true 4 | charset = utf-8 5 | 6 | [{Makefile,*.S,*.c,*.h}] 7 | indent_style = tab 8 | tab_width = 4 9 | -------------------------------------------------------------------------------- /sys/include/fukuro/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_SPINLOCK_H 2 | # define FUKURO_SPINLOCK_H 1 3 | 4 | struct spinlock 5 | { 6 | int lock; 7 | }; 8 | 9 | #endif /* FUKURO_SPINLOCK_H */ 10 | -------------------------------------------------------------------------------- /srv/Makefile.am: -------------------------------------------------------------------------------- 1 | exec_serverdir = \ 2 | $(exec_prefix)/boot/srv 3 | exec_server_PROGRAMS = 4 | 5 | LDADD = ../lib/crt0.o 6 | 7 | if ENABLE_FDOS 8 | include fdos-src/Makefrag.am 9 | endif 10 | -------------------------------------------------------------------------------- /compile_flags.txt: -------------------------------------------------------------------------------- 1 | -ansi 2 | -pedantic 3 | -pedantic-errors 4 | -Wall 5 | -Werror 6 | -Wextra 7 | -fno-builtin 8 | -Wno-variadic-macros 9 | -Dinline=__inline__ 10 | -Isrc/lib 11 | -Isys/ 12 | -Isys/include 13 | -------------------------------------------------------------------------------- /sys/i686/pmap.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_I386_PMAP_H 2 | # define FUKURO_I386_PMAP_H 1 3 | 4 | # include 5 | # include 6 | 7 | struct pmap 8 | { 9 | uintptr_t *dirbase; 10 | 11 | int refcount; 12 | 13 | struct spinlock lock; 14 | }; 15 | 16 | #endif /* !FUKURO_I386_PMAP_H */ 17 | -------------------------------------------------------------------------------- /sys/configfrag.ac: -------------------------------------------------------------------------------- 1 | AM_CONDITIONAL([HOST_aarch64], [test "$systype" = "aarch64"]) 2 | AM_CONDITIONAL([HOST_amd64], [test "$systype" = "amd64"]) 3 | AM_CONDITIONAL([HOST_arm], [test "$systype" = "arm"]) 4 | AM_CONDITIONAL([HOST_i686], [test "$systype" = "i686"]) 5 | AM_CONDITIONAL([HOST_riscv], [test "$systype" = "riscv"]) 6 | -------------------------------------------------------------------------------- /sys/include/fukuro/kinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_PARAM_H 2 | # define FUKURO_PARAM_H 1 3 | 4 | # include 5 | 6 | # define MEMMAP_MAX 40 7 | 8 | struct memory_map 9 | { 10 | uintptr_t address; 11 | uintptr_t length; 12 | }; 13 | 14 | struct kernel_info 15 | { 16 | struct memory_map mmap[MEMMAP_MAX]; 17 | }; 18 | 19 | #endif /* FUKURO_PARAM_H */ 20 | -------------------------------------------------------------------------------- /lib/minilibc/i686/crt0.S: -------------------------------------------------------------------------------- 1 | .section ".text" 2 | .align 4 3 | 4 | .extern __bss_begin 5 | .extern __bss_end 6 | .extern __minilibc_main 7 | 8 | .globl _start 9 | _start: 10 | xorl %ebp, %ebp 11 | 12 | xorl %eax, %eax 13 | movl $__bss_begin, %edi 14 | movl $__bss_end, %ecx 15 | subl %edi, %ecx 16 | cld 17 | rep 18 | stosb 19 | 20 | pushl %ebp 21 | 22 | call __minilibc_main 23 | 24 | hlt 25 | -------------------------------------------------------------------------------- /lib/csu/i686/crt0.S: -------------------------------------------------------------------------------- 1 | .section ".text" 2 | .align 4 3 | 4 | .extern __bss_begin 5 | .extern __bss_end 6 | .extern __minilibc_main 7 | 8 | .globl _start 9 | _start: 10 | xorl %ebp, %ebp 11 | 12 | xorl %eax, %eax 13 | movl $__bss_begin, %edi 14 | movl $__bss_end, %ecx 15 | subl %edi, %ecx 16 | cld 17 | rep 18 | stosb 19 | 20 | pushl %ebp 21 | 22 | call __minilibc_main 23 | 24 | hlt 25 | -------------------------------------------------------------------------------- /lib/minilibc/amd64/linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | 3 | SECTIONS { 4 | . = 4M; 5 | 6 | .text : ALIGN(4K) { 7 | *(.text); 8 | } 9 | 10 | .rodata : ALIGN(4K) { 11 | *(.rodata); 12 | } 13 | 14 | .data : ALIGN(4K) { 15 | *(.data); 16 | } 17 | 18 | .bss : ALIGN(4K) { 19 | *(COMMON); 20 | *(.bss); 21 | } 22 | 23 | PROVIDE(__bss_begin = ADDR(.bss)); 24 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 25 | } 26 | -------------------------------------------------------------------------------- /lib/csu/amd64/linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | 3 | SECTIONS { 4 | . = 4M; 5 | 6 | .text : ALIGN(4K) { 7 | *(.text); 8 | } 9 | 10 | .rodata : ALIGN(4K) { 11 | *(.rodata); 12 | } 13 | 14 | .data : ALIGN(4K) { 15 | *(.data); 16 | } 17 | 18 | .bss : ALIGN(4K) { 19 | *(COMMON); 20 | *(.bss); 21 | } 22 | 23 | PROVIDE(__bss_begin = ADDR(.bss)); 24 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 25 | } 26 | -------------------------------------------------------------------------------- /sys/arm/linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_entry) 2 | 3 | SECTIONS 4 | { 5 | . = 0x8000; 6 | 7 | .text : ALIGN(4K) { 8 | KEEP(*(.text.boot)) 9 | *(.text) 10 | } 11 | 12 | .rodata : ALIGN(4K) { 13 | *(.rodata) 14 | } 15 | 16 | .data : ALIGN(4K) { 17 | *(.data) 18 | } 19 | 20 | .bss : ALIGN(4K) { 21 | *(.bss) 22 | } 23 | 24 | PROVIDE(__bss_begin = ADDR(.bss)); 25 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 26 | } -------------------------------------------------------------------------------- /test/build.mk: -------------------------------------------------------------------------------- 1 | # vim: set tabstop=4:shiftwidth=4:noexpandtab 2 | 3 | TESTS_SRCS = itoa_test.c \ 4 | memset_test.c \ 5 | strlen_test.c \ 6 | strrev_test.c \ 7 | test.c 8 | 9 | TESTS_OBJS = $(addprefix $(TEST_BUILDDIR)/, $(TESTS_SRCS:.c=.o)) 10 | 11 | .PHONY: test 12 | test: $(TESTS_OBJS) $(LIB_MINIC_TEST_OBJS) 13 | $(CC) -o test.exe $^ $(TESTS_LDFLAGS) 14 | @ ./test.exe 15 | 16 | $(TEST_BUILDDIR)/%.o: test/%.c 17 | @ mkdir -p $(dir $@) 18 | $(CC) -o $@ -c $< $(TESTS_CFLAGS) 19 | 20 | -------------------------------------------------------------------------------- /sys/riscv/pmap.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_SYS_RISCV_PMAP_H 2 | # define FUKURO_SYS_RISCV_PMAP_H 1 3 | 4 | typedef struct { 5 | } PhyAddrMap; 6 | 7 | pmap_init(); 8 | PhysAddrMap pmap_create(); 9 | pmap_reference(); 10 | pmap_destroy(); 11 | pmap_remove(); 12 | pmap_remove_all(); 13 | pmap_copy_on_write(); 14 | pmap_enter(); 15 | pmap_protect(); 16 | pmap_extract(); 17 | pmap_access(); 18 | pmap_update(); 19 | pmap_activate(); 20 | pmap_deactivate(); 21 | pmap_zero_page(); 22 | pmap_copy_page(); 23 | 24 | #endif /* !FUKURO_SYS_RISCV_PMAP_H */ 25 | -------------------------------------------------------------------------------- /lib/minilibc/riscv/linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | 3 | SECTIONS { 4 | . = 0x1000000; 5 | 6 | .text :{ 7 | *(.text .text.*); 8 | } 9 | 10 | .rodata : ALIGN(4) { 11 | *(.rodata .rodata.*); 12 | } 13 | 14 | .data : ALIGN(4) { 15 | *(.data .data.*); 16 | } 17 | 18 | .bss : ALIGN(4) { 19 | *(.bss .bss.* .sbss .sbss.*); 20 | 21 | . = ALIGN(4); 22 | . += 64 * 1024; 23 | PROVIDE(__stack_top = .); 24 | } 25 | 26 | PROVIDE(__bss_begin = ADDR(.bss)); 27 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 28 | } 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | kernel.elf 3 | node_modules/ 4 | toolchain/ 5 | fukuro.iso 6 | *~ 7 | *.gcda 8 | *.gcno 9 | docs/html 10 | *.img 11 | 12 | .config 13 | .config.mk 14 | config.h 15 | *.old 16 | test.exe 17 | 18 | *.in 19 | /aclocal.m4 20 | *.sub 21 | *.guess 22 | /configure 23 | /install-sh 24 | Makefile 25 | /tmp 26 | /build 27 | build.mk 28 | /build-aux/ar-lib 29 | /build-aux/compile 30 | /build-aux/depcomp 31 | /build-aux/install-sh 32 | /build-aux/missing 33 | *.cache 34 | *.log 35 | *.status 36 | stamp-h1 37 | .deps 38 | .dirstamp 39 | 40 | /sys/fukuro 41 | machine 42 | -------------------------------------------------------------------------------- /lib/csu/riscv/linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | 3 | SECTIONS { 4 | . = 0x1000000; 5 | 6 | .text :{ 7 | *(.text .text.*); 8 | } 9 | 10 | .rodata : ALIGN(4) { 11 | *(.rodata .rodata.*); 12 | } 13 | 14 | .data : ALIGN(4) { 15 | *(.data .data.*); 16 | } 17 | 18 | .bss : ALIGN(4) { 19 | *(.bss .bss.* .sbss .sbss.*); 20 | 21 | . = ALIGN(4); 22 | . += 64 * 1024; 23 | PROVIDE(__stack_top = .); 24 | } 25 | 26 | PROVIDE(__bss_begin = ADDR(.bss)); 27 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 28 | } 29 | -------------------------------------------------------------------------------- /sys/Makefile.am: -------------------------------------------------------------------------------- 1 | fukuro_SOURCES = 2 | 3 | AM_CFLAGS = -I$(srcdir) -I$(srcdir)/include 4 | AM_LDFLAGS = -nostdlib -T$(srcdir)/$(systype)/kernel.lds 5 | 6 | if HOST_aarch64 7 | include aarch64/Makefrag.am 8 | endif 9 | 10 | if HOST_amd64 11 | include amd64/Makefrag.am 12 | endif 13 | 14 | if HOST_arm 15 | include arm/Makefrag.am 16 | endif 17 | 18 | if HOST_i686 19 | include i686/Makefrag.am 20 | endif 21 | 22 | if HOST_riscv 23 | include riscv/Makefrag.am 24 | endif 25 | 26 | fukuro_SOURCES += main.c version.c 27 | 28 | exec_bootdir = \ 29 | $(exec_prefix)/boot 30 | exec_boot_PROGRAMS = \ 31 | fukuro 32 | -------------------------------------------------------------------------------- /docs/layout.md: -------------------------------------------------------------------------------- 1 | # Source layout 2 | 3 | - `docs/` Documentation 4 | - `make/` Makefiles helper 5 | - `aarch64/` 6 | - `arm/` 7 | - `x86/` 8 | - `32/` 9 | - `64/` 10 | - `src/` 11 | - `kernel/` 12 | - `arch/` 13 | - `aarch64/` 14 | - `arm/` 15 | - `x86/` 16 | - `32/` 17 | - `64/` 18 | - `lib/` 19 | - `minic/` 20 | - `fukuro/` 21 | - `server/` 22 | - `net/` 23 | - `rtl8139/` 24 | - `test/` 25 | - `thirdparty/` Sources code from external source 26 | - `tools/` Scripts used in order to build Fukurō 27 | -------------------------------------------------------------------------------- /.github/workflows/doc.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Documentation 3 | 4 | on: 5 | # Trigger the workflow on push or pull request, 6 | # but only for the main branch 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | docs: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v1 17 | name: Checkout 18 | 19 | - uses: mattnotmitt/doxygen-action@v1 20 | name: Generate documentation 21 | 22 | - name: Deploy 23 | uses: peaceiris/actions-gh-pages@v3 24 | with: 25 | github_token: ${{ secrets.GITHUB_TOKEN }} 26 | publish_dir: ./docs/html 27 | cname: fukuro.dev -------------------------------------------------------------------------------- /tools/format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | check_cmd () { 4 | if ! command -v $1 > /dev/null 5 | then 6 | echo "$1 not found" 7 | exit 8 | fi 9 | } 10 | 11 | check_cmd "dos2unix" 12 | check_cmd "indent" 13 | 14 | dos2unix $@ 15 | 16 | indent \ 17 | -bad -bap \ 18 | -bl -blf -bli0 -bbo \ 19 | -i4 \ 20 | -l79 -lp \ 21 | -ut -ts4 \ 22 | -ppi1 -psl \ 23 | -c33 -cd33 -cdb -nce -cli1 -cp33 -ncs \ 24 | -di16 \ 25 | -fc1 -fca \ 26 | -npcs -nprs \ 27 | -saf -sai -saw \ 28 | -sc -nsob -nss \ 29 | -T int8_t -T uint8_t -T int16_t -T uint16_t \ 30 | -T int32_t -T uint32_t -T int64_t -T uint64_t \ 31 | $@ 32 | -------------------------------------------------------------------------------- /sys/riscv/kernel.lds: -------------------------------------------------------------------------------- 1 | ENTRY(_entry) 2 | 3 | SECTIONS { 4 | . = 0x80200000; 5 | 6 | .text :{ 7 | KEEP(*(.text.boos)); 8 | *(.text .text.*); 9 | } 10 | 11 | .rodata : ALIGN(4) { 12 | *(.rodata .text.*); 13 | } 14 | 15 | .data : ALIGN(4) { 16 | *(.data .data.*); 17 | } 18 | 19 | .bss : ALIGN(4) { 20 | *(.bss .bss.*); 21 | *(COMMON); 22 | } 23 | 24 | PROVIDE(__bss_begin = ADDR(.bss)); 25 | PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); 26 | 27 | .stack (NOLOAD) : ALIGN(4) { 28 | . += 16 * 1024; /* 16KB */ 29 | PROVIDE(__stack_top = .); 30 | } 31 | 32 | /* XXX: temporary */ 33 | . = ALIGN(4096); 34 | PROVIDE(__free_ram_begin = .); 35 | . += 256 * 1024 * 1024; /* 256MB */ 36 | PROVIDE(__free_ram_end = .); 37 | } 38 | -------------------------------------------------------------------------------- /sys/i686/unpaged_init.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static struct kernel_info kinfo; 7 | 8 | static void 9 | unpaged_add_mmap_entry(uint64_t addr, uint64_t len) 10 | { 11 | if (addr > 0xFFFFF000) return; 12 | 13 | if (addr + len > 0xFFFFF000) len -= (addr + len) - 0xFFFFF000; 14 | } 15 | 16 | struct kernel_info * 17 | unpaged_init(uint32_t magic, struct multiboot *mb) 18 | { 19 | if (magic != MULTIBOOT_BOOTLOADER_MAGIC) 20 | { 21 | return (NULL); /* :'( */ 22 | } 23 | 24 | if (mb->flags & MULTIBOOT_INFO_MMAP) 25 | { 26 | unpaged_add_mmap_entry(0, 0); 27 | 28 | } 29 | else if (mb->flags & MULTIBOOT_INFO_MEM) 30 | { 31 | /* TODO */ 32 | } 33 | else 34 | { 35 | return (NULL); /* :'( */ 36 | } 37 | 38 | return (&kinfo); 39 | } 40 | -------------------------------------------------------------------------------- /sys/i686/kernel.lds: -------------------------------------------------------------------------------- 1 | 2 | OUTPUT_ARCH("i386") 3 | ENTRY(_entry) 4 | 5 | _kern_phys_base = 1M; 6 | _kern_virt_base = 0xC0100000; 7 | _kern_offset = _kern_virt_base - _kern_phys_base; 8 | 9 | SECTIONS { 10 | . = _kern_phys_base; 11 | 12 | .unpaged_text : { 13 | i686/boot.o(.text.boot .text) 14 | i686/unpaged_*.o(.text) 15 | } 16 | 17 | .unpaged_data : { 18 | i686/boot.o(.data) 19 | i686/unpaged_*.o(.text) 20 | } 21 | 22 | .unpaged_bss : { 23 | i686/boot.o(.bss) 24 | i686/unpaged_*.o(.bss) 25 | } 26 | 27 | . += _kern_offset; 28 | 29 | .text : { 30 | *(.text.boot) 31 | *(.text) 32 | } 33 | 34 | .data : { 35 | *(.data) 36 | } 37 | 38 | .rodata : { 39 | *(.rodata) 40 | } 41 | 42 | .bss : { 43 | bss_begin = .; 44 | *(COMMON) 45 | *(.bss) 46 | bss_end = .; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [ master ] 9 | schedule: 10 | - cron: '27 6 * * 4' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | language: [ 'cpp' ] 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v2 29 | run: | 30 | sudo apt-get update 31 | sudo apt-get install build-essential libcmocka-dev 32 | 33 | - name: Initialize CodeQL 34 | uses: github/codeql-action/init@v2 35 | with: 36 | languages: ${{ matrix.language }} 37 | 38 | - name: Build 39 | run: | 40 | make test 41 | 42 | - name: Perform CodeQL Analysis 43 | uses: github/codeql-action/analyze@v2 44 | -------------------------------------------------------------------------------- /docs/theme/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | DevSE WebRing: previous next 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/credits.md: -------------------------------------------------------------------------------- 1 | # Credits 2 | 3 | Fukurō takes inspirations and/or reuse code from the following projects: 4 | 5 | ## BRUTAL 6 | 7 | Striking modernist shapes and bold use of modern C are the hallmarks of BRUTAL. Inspired by brutalist design BRUTAL combines the ideals of UNIX from the 1970s with modern technology and engineering. 8 | 9 | URL: 10 | 11 | ``` 12 | MIT License 13 | 14 | Copyright (c) 2021-2022 The brutal operating system contributors 15 | ``` 16 | 17 | ## cute-engineewing 18 | 19 | A group of hackers who design minimalist software. 20 | 21 | URL: 22 | 23 | ``` 24 | BSD 3-Clause License 25 | 26 | Copyright (c) 2021, cute-engineewing 27 | Copyright (c) 2021, The µnix Contributors 28 | ``` 29 | 30 | ## Minix 3 31 | 32 | Minix (from mini-Unix) is a Unix-like operating system. 33 | 34 | URL: 35 | 36 | ``` 37 | BSD 3-Clause License 38 | 39 | Copyright (c) 1987,1997,2001 Prentice Hall 40 | ``` 41 | 42 | ## Albert Hofmann 43 | 44 | The first known person to synthesize, ingest, and learn of the psychedelic effects of lysergic acid diethylamide (LSD). 45 | -------------------------------------------------------------------------------- /sys/vm/vm.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_SYS_VM_VM_H 2 | # define FUKURO_SYS_VM_VM_H 1 3 | 4 | /* our virtual memory manager is mosly based on Rashid's paper 5 | * https://research.cs.wisc.edu/areas/os/Qual/papers/mach-memory.pdf 6 | */ 7 | 8 | /** 9 | * Allocate and fill with zeros new virtual memory either anywhre 10 | * or at a specified address. 11 | */ 12 | vm_allocate(); 13 | 14 | /** 15 | * Virtually copy a range of memory from one address to another. 16 | */ 17 | vm_copy(); 18 | 19 | /** 20 | * Deallocate a range of addresses, i.e make them no longer valid. 21 | */ 22 | vm_deallocate(); 23 | 24 | /** 25 | * Set the inheritance attribute of an address range. 26 | */ 27 | vm_inherit(); 28 | 29 | /** 30 | * Set the protection attribute of an address range. 31 | */ 32 | vm_protect(); 33 | 34 | /** 35 | * Read the contents of a region of a task's address space. 36 | */ 37 | vm_read(); 38 | 39 | /** 40 | * Return description of specified region of task's address space. 41 | */ 42 | vm_regions(); 43 | 44 | /** 45 | * Return statistics about the use of memory by a targe_task. 46 | */ 47 | vm_statistics(); 48 | 49 | /** 50 | * Write the contents of a region of a task's address space. 51 | */ 52 | vm_write(); 53 | 54 | #endif /* !FUKURO_SYS_VM_VM_H */ 55 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: Fukurō 3 | message: >- 4 | If you use this software, please cite it using the 5 | metadata from this file. 6 | type: software 7 | authors: 8 | - given-names: d0p1 9 | email: contact@d0p1.eu 10 | orcid: 'https://orcid.org/0009-0001-8345-4627' 11 | identifiers: 12 | - type: url 13 | value: 'https://github.com/d0p1s4m4/Fukuro/releases' 14 | repository-code: 'https://github.com/d0p1s4m4/Fukuro' 15 | url: 'https://Fukuro.dev' 16 | keywords: 17 | - Microkernel 18 | - Operating System 19 | license: CECILL-2.1 20 | version: X.X.X 21 | date-released: '2023-01-01' 22 | references: 23 | - authors: 24 | - family-names: Rashid 25 | given-names: Richard 26 | - family-names: Tevanian 27 | given-names: Avadis 28 | - family-names: Young 29 | given-names: Michael 30 | - family-names: Golub 31 | given-names: David 32 | - family-names: Baron 33 | given-names: Robert 34 | - family-names: Black 35 | given-names: David 36 | - family-names: Bolosky 37 | given-names: William 38 | - family-names: Chew 39 | given-names: Jonathan 40 | title: "Machine-Independent Virtual Memory Management for Paged Uniprocessor and 41 | Multiprocessor Architectures" 42 | type: article 43 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | 2 | name: CI 3 | 4 | on: [push, pull_request] 5 | 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | strategy: 10 | matrix: 11 | arch: [i686, aarch64, arm, x86_64] 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Install build dependencies 15 | run: | 16 | sudo apt-get update 17 | sudo apt-get install build-essential flex bison 18 | sudo apt-get install texinfo wget mtools 19 | sudo apt-get install libmpc-dev libgmp-dev libmpfr-dev 20 | sudo apt-get install grub-common nasm 21 | - uses: actions/cache@v1 22 | id: cache 23 | with: 24 | path: toolchain 25 | key: toolchain-${{ matrix.arch }} 26 | 27 | - name: Build toolchain ${{ matrix.arch }} 28 | run: ARCH=${{ matrix.arch }} ./tools/build_toolchain.sh 29 | 30 | - name: Build Fukuro ${{ matrix.arch }} 31 | run: ARCH=${{ matrix.arch }} make 32 | 33 | test: 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@v1 37 | - name: Install test dependencies 38 | run: | 39 | sudo apt-get update 40 | sudo apt-get install build-essential libcmocka-dev 41 | - name: Build and run tests 42 | run: make test 43 | - name: Upload coverage to Codecov 44 | uses: codecov/codecov-action@v1 45 | -------------------------------------------------------------------------------- /test/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Fukurō. 3 | * 4 | * Fukurō is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * any later version. 8 | * 9 | * Fukurō is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Fukurō. If not, see . 16 | */ 17 | 18 | int strlen_group_tests(void); 19 | int strrev_group_tests(void); 20 | int itoa_group_tests(void); 21 | int memset_group_tests(void); 22 | 23 | /* 24 | * required by logger.c 25 | */ 26 | void 27 | debug_puts(const char *str) 28 | { 29 | (void)str; 30 | } 31 | 32 | /* 33 | * required by logger.c 34 | */ 35 | void 36 | debug_putchar(const char c) 37 | { 38 | (void)c; 39 | } 40 | 41 | int 42 | main(void) 43 | { 44 | int result; 45 | 46 | result = 0; 47 | result |= strlen_group_tests(); 48 | result |= strrev_group_tests(); 49 | result |= itoa_group_tests(); 50 | result |= memset_group_tests(); 51 | 52 | return (result); 53 | } 54 | -------------------------------------------------------------------------------- /test/strlen_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Fukurō. 3 | * 4 | * Fukurō is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * any later version. 8 | * 9 | * Fukurō is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Fukurō. If not, see . 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static void 27 | strlen_test_empty_string(void **state) 28 | { 29 | (void)state; 30 | assert_int_equal(strlen(""), 0); 31 | } 32 | 33 | static void 34 | strlen_test_fixed_length_strings(void **state) 35 | { 36 | (void)state; 37 | assert_int_equal(strlen("a"), 1); 38 | assert_int_equal(strlen("abcd"), 4); 39 | } 40 | 41 | int 42 | strlen_group_tests(void) 43 | { 44 | const struct CMUnitTest tests[] = { 45 | cmocka_unit_test(strlen_test_empty_string), 46 | cmocka_unit_test(strlen_test_fixed_length_strings), 47 | }; 48 | 49 | return cmocka_run_group_tests(tests, NULL, NULL); 50 | } 51 | -------------------------------------------------------------------------------- /test/strrev_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Fukurō. 3 | * 4 | * Fukurō is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * any later version. 8 | * 9 | * Fukurō is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Fukurō. If not, see . 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static void 27 | strrev_test_empty_string(void **state) 28 | { 29 | (void)state; 30 | assert_string_equal(strrev(""), ""); 31 | } 32 | 33 | static void 34 | strrev_test_fixed_length_strings(void **state) 35 | { 36 | char buff[] = "abc"; 37 | 38 | (void)state; 39 | assert_string_equal(strrev(buff), "cba"); 40 | } 41 | 42 | int 43 | strrev_group_tests(void) 44 | { 45 | const struct CMUnitTest tests[] = { 46 | cmocka_unit_test(strrev_test_empty_string), 47 | cmocka_unit_test(strrev_test_fixed_length_strings), 48 | }; 49 | 50 | return cmocka_run_group_tests(tests, NULL, NULL); 51 | } 52 | -------------------------------------------------------------------------------- /test/memset_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Fukurō. 3 | * 4 | * Fukurō is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * any later version. 8 | * 9 | * Fukurō is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Fukurō. If not, see . 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static void 27 | bzero_test(void **state) 28 | { 29 | char buff[3] = "ok"; 30 | 31 | (void)state; 32 | bzero(buff, 3); 33 | assert_memory_equal(buff, "\0\0\0", 3); 34 | } 35 | 36 | static void 37 | memset_test(void **state) 38 | { 39 | char buff[5]; 40 | 41 | (void)state; 42 | assert_ptr_equal(memset(buff, 'a', 5), buff); 43 | assert_memory_equal(buff, "aaaaa", 5); 44 | } 45 | 46 | int 47 | memset_group_tests(void) 48 | { 49 | const struct CMUnitTest tests[] = { 50 | cmocka_unit_test(bzero_test), 51 | cmocka_unit_test(memset_test), 52 | }; 53 | 54 | return cmocka_run_group_tests(tests, NULL, NULL); 55 | } 56 | -------------------------------------------------------------------------------- /lib/minilibc/minilibc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | void 34 | __minilibc_main(void) 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /lib/minilibc/arm/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text" 34 | 35 | .globl _start 36 | _start: 37 | b main 38 | -------------------------------------------------------------------------------- /lib/csu/arm/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text" 34 | 35 | .globl _start 36 | _start: 37 | b main 38 | -------------------------------------------------------------------------------- /srv/fdos-src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | (void)argc; 37 | (void)argv; 38 | return (0); 39 | } 40 | -------------------------------------------------------------------------------- /sbin/service/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | (void)argc; 37 | (void)argv; 38 | 39 | return (0); 40 | } 41 | -------------------------------------------------------------------------------- /srv/random/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | (void)argc; 37 | (void)argv; 38 | return (0); 39 | } 40 | -------------------------------------------------------------------------------- /srv/vfs/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | (void)argc; 37 | (void)argv; 38 | return (0); 39 | } 40 | -------------------------------------------------------------------------------- /sys/riscv/trap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | #include 33 | 34 | void 35 | kernel_trap(TrapFrame *frame) 36 | { 37 | (void)frame; 38 | } 39 | -------------------------------------------------------------------------------- /sys/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | #include 34 | 35 | static struct kernel_info kinfo; 36 | 37 | void 38 | kmain(struct kernel_info *boot_kinfo) 39 | { 40 | memcpy(&kinfo, boot_kinfo, sizeof(struct kernel_info)); 41 | 42 | /* plat_init(); */ 43 | } 44 | -------------------------------------------------------------------------------- /lib/minilibc/string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | #ifndef FUKURO_MINILIBC_H 34 | # define FUKURO_MINILIBC_H 1 35 | 36 | # include 37 | 38 | void *memset(void *dest, int c, size_t count); 39 | size_t strlen(const char *str); 40 | 41 | #endif /* !FUKURO_MINILIBC_H */ 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | # Fukurō (フクロウ) 5 | 6 | [![License CeCILL-2.1](https://img.shields.io/github/license/d0p1s4m4/Fukuro?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgOTgwIDk4MCI+PGNpcmNsZSBjeD0iNDkwIiBjeT0iNDkwIiByPSI0NDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIxMDAiLz48cGF0aCBkPSJNMjE5LDQyOEgzNTBhMTUwLDE1MCAwIDEgMSAwLDEyNUgyMTlhMjc1LDI3NSAwIDEgMCAwLTEyNXoiLz4NCjwvc3ZnPg==&style=flat-square)](./LICENSE) 7 | [![License GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-orange?style=flat-square&logo=gnu)](./LICENSE.GPL3) 8 | [![GitHub issues](https://img.shields.io/github/issues/d0p1s4m4/Fukuro?logo=github&style=flat-square)](https://github.com/d0p1s4m4/Fukuro/issues) 9 | [![Codecov](https://img.shields.io/codecov/c/github/d0p1s4m4/Fukuro?logo=codecov&style=flat-square)](https://codecov.io/gh/d0p1s4m4/Fukuro/) 10 | [![GitHub Sponsors](https://img.shields.io/github/sponsors/d0p1s4m4?style=flat-square&logo=githubsponsors)](https://github.com/sponsors/d0p1s4m4/) 11 | [![Liberapay receiving](https://img.shields.io/liberapay/receives/d0p1?logo=liberapay&style=flat-square)](https://liberapay.com/d0p1) 12 | 13 | 14 |
15 | 16 | Fukurō aims to be a highly portable microkernel 17 | 18 |
19 | 20 | ![fukuro i686](.github/screen/fukuro_vbox.png) 21 | 22 |
23 | 24 | 25 | ## License 26 | 27 | OSI Approved License 28 | 29 | Fukuro is dual-licensed under the CeCILL and GPLv3 License. 30 | 31 | The full text of the license can be accessed via [this link](https://cecill.info/licences/Licence_CeCILL_V2.1-fr.txt) and is also included in [the license file](./LICENSE) of this software package. 32 | -------------------------------------------------------------------------------- /test/itoa_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Fukurō. 3 | * 4 | * Fukurō is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * any later version. 8 | * 9 | * Fukurō is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with Fukurō. If not, see . 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static void 27 | itoa_test_hex_deadbeef(void **state) 28 | { 29 | char buff[7]; 30 | 31 | (void)state; 32 | assert_string_equal(itoa(0xC0FFEE, buff, 16), "C0FFEE"); 33 | } 34 | 35 | static void 36 | itoa_test_hex_f(void **state) 37 | { 38 | char buff[2]; 39 | 40 | (void)state; 41 | assert_string_equal(itoa(0xF, buff, 16), "F"); 42 | } 43 | 44 | static void 45 | itoa_test_binary_2(void **state) 46 | { 47 | char buff[3]; 48 | 49 | (void)state; 50 | assert_string_equal(itoa(2, buff, 2), "10"); 51 | } 52 | 53 | static void 54 | itoa_test_42(void **state) 55 | { 56 | char buff[3]; 57 | 58 | (void)state; 59 | assert_string_equal(itoa(42, buff, 10), "42"); 60 | } 61 | 62 | int 63 | itoa_group_tests(void) 64 | { 65 | const struct CMUnitTest tests[] = { 66 | cmocka_unit_test(itoa_test_hex_deadbeef), 67 | cmocka_unit_test(itoa_test_hex_f), 68 | cmocka_unit_test(itoa_test_binary_2), 69 | cmocka_unit_test(itoa_test_42), 70 | }; 71 | 72 | return cmocka_run_group_tests(tests, NULL, NULL); 73 | } 74 | -------------------------------------------------------------------------------- /sys/arm/boot.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text.boot" 34 | 35 | .extern __bss_begin 36 | .extern __bss_end 37 | .extern kmain 38 | 39 | .globl _entry 40 | _entry: 41 | mov r0, #0 42 | ldr r1, =(__bss_begin) 43 | ldr r2, =(__bss_end) 44 | 45 | 1: 46 | strt r0, [r1, #0] 47 | add r1, #4 48 | cmp r2, r1 49 | bgt 1b 50 | 51 | bl kmain 52 | nop 53 | 54 | hang: 55 | b hang 56 | -------------------------------------------------------------------------------- /lib/minilibc/riscv/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text" 34 | 35 | .extern __stack_top 36 | .extern __bss_begin 37 | .extern __bss_end 38 | .extern __minilibc_main 39 | 40 | .globl _start 41 | _start: 42 | la sp, __stack_top 43 | 44 | la t0, __bss_begin 45 | la t1, __bss_end 46 | 47 | bltu t1, t0, 2f 48 | 1: 49 | sw x0, (t0) 50 | addi t0, t0, 4 51 | bltu t0, t1, 1b 52 | 2: 53 | 54 | call __minilibc_main 55 | -------------------------------------------------------------------------------- /lib/minilibc/amd64/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section .text 34 | .align 8 35 | 36 | .extern __bss_begin 37 | .extern __bss_end 38 | .extern __minilibc_main 39 | 40 | .globl _start 41 | _start: 42 | xorq %rbp, %rbp 43 | 44 | /* clear bss */ 45 | xorq %rax, %rax 46 | movq $__bss_begin, %rdi 47 | movq $__bss_end, %rcx 48 | subq %rdi, %rcx 49 | cld 50 | rep 51 | stosb 52 | 53 | movq %rsp, %rdi 54 | call __minilibc_main 55 | 56 | hlt 57 | -------------------------------------------------------------------------------- /lib/csu/riscv/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text" 34 | 35 | .extern __stack_top 36 | .extern __bss_begin 37 | .extern __bss_end 38 | .extern __minilibc_main 39 | 40 | .globl _start 41 | _start: 42 | la sp, __stack_top 43 | 44 | la t0, __bss_begin 45 | la t1, __bss_end 46 | 47 | bltu t1, t0, 2f 48 | 1: 49 | sw x0, (t0) 50 | addi t0, t0, 4 51 | bltu t0, t1, 1b 52 | 2: 53 | 54 | call __minilibc_main 55 | -------------------------------------------------------------------------------- /sys/riscv/boot.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | .section ".text.boot" 33 | 34 | .extern __stack_top 35 | .extern __bss_begin 36 | .extern __bss_end 37 | .extern kmain 38 | 39 | .globl _entry 40 | 41 | _entry: 42 | la sp, __stack_top 43 | 44 | la t0, __bss_begin 45 | la t1, __bss_end 46 | 47 | bltu t1, t0, 2f 48 | 1: 49 | sw x0, (t0) 50 | addi t0, t0, 4 51 | bltu t0, t1, 1b 52 | 2: 53 | call kmain 54 | 55 | hang: 56 | j hang 57 | -------------------------------------------------------------------------------- /lib/csu/amd64/crt0.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section .text 34 | .align 8 35 | 36 | .extern __bss_begin 37 | .extern __bss_end 38 | .extern __minilibc_main 39 | 40 | .globl _start 41 | _start: 42 | xorq %rbp, %rbp 43 | 44 | /* clear bss */ 45 | xorq %rax, %rax 46 | movq $__bss_begin, %rdi 47 | movq $__bss_end, %rcx 48 | subq %rdi, %rcx 49 | cld 50 | rep 51 | stosb 52 | 53 | movq %rsp, %rdi 54 | call __minilibc_main 55 | 56 | hlt 57 | -------------------------------------------------------------------------------- /sys/vm/pmap.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_SYS_VM_PMAP_H 2 | # define FUKURO_SYS_VM_PMAP_H 1 3 | 4 | # include 5 | 6 | typedef struct pmap *pmap_t; 7 | 8 | /** 9 | * Initialize using specified range of physical address 10 | */ 11 | void pmap_init(uintptr_t start, uintptr_t end); 12 | 13 | /** 14 | * Create a new physical map 15 | */ 16 | pmap_t pmap_create(void); 17 | 18 | /** 19 | * Add a reference to a physical map 20 | */ 21 | void pmap_reference(pmap_t pmap); 22 | 23 | /** 24 | * Deference physical map, destroy if no references remain 25 | */ 26 | void pmap_destroy(pmap_t pmap); 27 | 28 | /** 29 | * Remove the specified range of virtual address from map. 30 | * (Used in memory deallocation) 31 | */ 32 | void pmap_remove(pmap_t pmap, uintptr_t start, uintptr_t end); 33 | 34 | /** 35 | * Remove physical page from all maps. 36 | * (pageout) 37 | */ 38 | void pmap_remove_all(uintptr_t phys); 39 | 40 | /** 41 | * Remove write access for page from all maps 42 | * (virtual copy of shared page) 43 | */ 44 | void pmap_copy_on_write(uintptr_t phys); 45 | 46 | /** 47 | * Enter mapping. 48 | * (page fault) 49 | */ 50 | void pmap_enter(pmap_t pmap, v, p, prot, wired); 51 | 52 | /** 53 | * Set the protection on the specified range of address. 54 | */ 55 | void pmap_protect(pmap_t map, start, end, prot); 56 | 57 | /** 58 | * Convert virtual to physical. 59 | */ 60 | uintptr_t pmap_extract(pmap_t pmap, uintptr_t va); 61 | 62 | /** 63 | * Report if virtual address is mapped 64 | */ 65 | bool pmap_access(pmap_t pmap, uintptr_t va); 66 | 67 | /** 68 | * Sync pmap system 69 | */ 70 | void pmap_update(void); 71 | 72 | /** 73 | * Setup map thread to run on cpu 74 | */ 75 | void pmap_activate(pmap_t pmap, thread, cpu); 76 | 77 | /** 78 | * Map thread are done on cpu 79 | */ 80 | void pmpa_deactivate(pmap_t pmap, thread, cpu); 81 | 82 | /** 83 | * Zero fill physical page. 84 | */ 85 | void pmap_zero_page(uintptr_t phys); 86 | 87 | /** 88 | * Copy physical page. 89 | * (modify/reference bit maintenance) 90 | */ 91 | void pmap_copy_page(uintptr_t src, uintptr_t dest); 92 | 93 | 94 | 95 | #endif /* !FUKURO_SYS_VM_PMAP_H */ 96 | -------------------------------------------------------------------------------- /.github/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sys/aarch64/boot.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | .section ".text.boot" 34 | 35 | .extern arch_init 36 | .extern bzero 37 | 38 | .globl _start 39 | _start: 40 | mrs x0, mpidr_el1 /* read multiprocessor affinity reg */ 41 | and x0, x0, #3 /* check if core 0 otherwhise hang */ 42 | cbz x0, master 43 | proc_hang: 44 | b proc_hang 45 | 46 | master: 47 | /* set stack before code */ 48 | ldr x1, =_start 49 | mov sp, x1 50 | 51 | ldr x0, =bss_begin 52 | ldr x1, =bss_end 53 | sub x1, x1, x0 54 | bl bzero /* clear .bss section */ 55 | 56 | /* start kernel */ 57 | bl kmain 58 | 59 | b proc_hang 60 | -------------------------------------------------------------------------------- /sys/amd64/kernel.lds: -------------------------------------------------------------------------------- 1 | /* Tell the linker that we want an x86_64 ELF64 output file */ 2 | OUTPUT_FORMAT(elf64-x86-64) 3 | OUTPUT_ARCH(i386:x86-64) 4 | 5 | /* We want the symbol _start to be our entry point */ 6 | ENTRY(_entry) 7 | 8 | /* Define the program headers we want so the bootloader gives us the right */ 9 | /* MMU permissions */ 10 | PHDRS 11 | { 12 | requests PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */ 13 | text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */ 14 | rodata PT_LOAD FLAGS((1 << 2)) ; /* Read only */ 15 | data PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */ 16 | dynamic PT_DYNAMIC FLAGS((1 << 1) | (1 << 2)) ; /* Dynamic PHDR for relocations */ 17 | } 18 | 19 | SECTIONS 20 | { 21 | /* We wanna be placed in the topmost 2GiB of the address space, for optimisations */ 22 | /* and because that is what the Limine spec mandates. */ 23 | /* Any address in this region will do, but often 0xffffffff80000000 is chosen as */ 24 | /* that is the beginning of the region. */ 25 | . = 0xffffffff80000000; 26 | 27 | /* Define a section to contain the Limine requests and assign it to its own PHDR */ 28 | .requests : { 29 | KEEP(*(.requests_start_marker)) 30 | KEEP(*(.requests)) 31 | KEEP(*(.requests_end_marker)) 32 | } :requests 33 | 34 | /* Move to the next memory page for .text */ 35 | . += CONSTANT(MAXPAGESIZE); 36 | 37 | .text : { 38 | *(.text .text.*) 39 | } :text 40 | 41 | /* Move to the next memory page for .rodata */ 42 | . += CONSTANT(MAXPAGESIZE); 43 | 44 | .rodata : { 45 | *(.rodata .rodata.*) 46 | } :rodata 47 | 48 | /* Move to the next memory page for .data */ 49 | . += CONSTANT(MAXPAGESIZE); 50 | 51 | .data : { 52 | *(.data .data.*) 53 | } :data 54 | 55 | /* Dynamic section for relocations, both in its own PHDR and inside data PHDR */ 56 | .dynamic : { 57 | *(.dynamic) 58 | } :data :dynamic 59 | 60 | /* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */ 61 | /* unnecessary zeros will be written to the binary. */ 62 | /* If you need, for example, .init_array and .fini_array, those should be placed */ 63 | /* above this. */ 64 | .bss : { 65 | *(.bss .bss.*) 66 | *(COMMON) 67 | } :data 68 | 69 | /* Discard .note.* and .eh_frame since they may cause issues on some hosts. */ 70 | /DISCARD/ : { 71 | *(.eh_frame) 72 | *(.note .note.*) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /sys/riscv/asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | #ifndef FUKURO_SYS_RISCV_ASM_H 33 | # define FUKURO_SYS_RISCV_ASM_H 1 34 | 35 | # ifndef __ASSEMBLY__ 36 | 37 | # include 38 | 39 | typedef struct __attribute__((packed)) 40 | { 41 | uint32_t ra; 42 | uint32_t sp; 43 | uint32_t gp; 44 | uint32_t tp; 45 | uint32_t t0; 46 | uint32_t t1; 47 | uint32_t t2; 48 | uint32_t s0; 49 | uint32_t s1; 50 | uint32_t a0; 51 | uint32_t a1; 52 | uint32_t a2; 53 | uint32_t a3; 54 | uint32_t a4; 55 | uint32_t a5; 56 | uint32_t a6; 57 | uint32_t a7; 58 | uint32_t s2; 59 | uint32_t s3; 60 | uint32_t s4; 61 | uint32_t s5; 62 | uint32_t s6; 63 | uint32_t s7; 64 | uint32_t s8; 65 | uint32_t s9; 66 | uint32_t s10; 67 | uint32_t s11; 68 | uint32_t t3; 69 | uint32_t t4; 70 | uint32_t t5; 71 | uint32_t t9; 72 | } TrapFrame; 73 | 74 | # endif /* __ASSEMBLY__ */ 75 | 76 | #endif /* !FUKURO_SYS_RISCV_ASM_H */ 77 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | m4_define([fukuro_VERSION], 2 | m4_esyscmd([build-aux/git-version])) 3 | AC_INIT([Fukuro], 4 | m4_defn([fukuro_VERSION]), 5 | [https://github.com/d0p1s4m4/Fukuro/issues]) 6 | AC_COPYRIGHT([Copyright (C) 2023 d0p1]) 7 | 8 | CFLAGS="-ffreestanding -nostdlib -fno-builtin" 9 | 10 | AC_CONFIG_AUX_DIR([build-aux]) 11 | 12 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 13 | 14 | dnl overide default AC_LANG_PROGRAM(C) macro 15 | m4_ifdef([AC_LANG_PROGRAM(c)], m4_undefine[AC_LANG_PROGRAM(c)]) 16 | m4_define([AC_LANG_PROGRAM(C)], 17 | [$1 18 | 19 | int 20 | _start (void) 21 | { 22 | $2 23 | ; 24 | return 0; 25 | }]) 26 | 27 | AC_CANONICAL_HOST 28 | 29 | AS_CASE([$host_cpu], 30 | [i?86], [ 31 | systype=i686 32 | ], 33 | [x86_64], [systype=amd64], 34 | [systype=$host_cpu] 35 | ) 36 | AC_SUBST([systype]) 37 | 38 | m4_include([sys/configfrag.ac]) 39 | 40 | AS_IF([! test -d "$srcdir/sys/$systype"], 41 | [AC_MSG_ERROR(["$host_cpu isn't supported by Fukuro"])]) 42 | 43 | AC_CONFIG_HEADERS([config.h]) 44 | AC_CONFIG_FILES([Makefile lib/Makefile srv/Makefile sys/Makefile]) 45 | 46 | AC_LANG([C]) 47 | save_cross_compiling=$cross_compiling 48 | cross_compiling=yes 49 | AM_PROG_AS 50 | cross_compiling=$save_cross_compiling 51 | AC_PROG_CC 52 | AC_PROG_CPP 53 | AC_PROG_RANLIB 54 | AC_PROG_LN_S 55 | AC_PROG_MKDIR_P 56 | AC_PROG_CC_C_O 57 | AM_PROG_AR 58 | AX_ASM_INLINE 59 | AX_C___ATTRIBUTE__ 60 | 61 | AC_CHECK_TOOL([STRIP], [strip]) 62 | AC_CHECK_TOOL([OBJCOPY], [objcopy]) 63 | AC_CHECK_PROG([GZIP], [gzip], [gzip]) 64 | AC_CHECK_PROG([QEMU], [qemu-system-$host_cpu], [qemu-system-$host_cpu]) 65 | AC_CHECK_PROG([PYTHON3], [python3], [python3]) 66 | AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen]) 67 | AC_CHECK_PROG([FIG], [fig], [fig]) 68 | 69 | AC_C_CONST 70 | AC_C_INLINE 71 | AC_C_VOLATILE 72 | AC_C_BIGENDIAN 73 | AC_CHECK_HEADERS([stdarg.h]) 74 | AC_C_STRINGIZE 75 | 76 | AC_CHECK_TYPE(uintptr_t) 77 | AC_TYPE_SIZE_T 78 | 79 | AC_CONFIG_LINKS(["sys/machine":"$srcdir/sys/$systype"]) 80 | 81 | AC_ARG_ENABLE([ncpus], 82 | AS_HELP_STRING([--enable-ncpus=N], [specify the maximum number of cpus to be supported]), 83 | [fukuro_ncpus=$enable_ncpus], 84 | [1]) 85 | AC_DEFINE_UNQUOTED([NCPUS], [$fukuro_ncpus], [number of CPUs]) 86 | 87 | m4_include([srv/configfrag.ac]) 88 | 89 | AC_OUTPUT 90 | AC_MSG_RESULT([ 91 | Fukurō version: $PACKAGE_STRING 92 | Architecture: $host_cpu 93 | 94 | C Compiler: $CC 95 | ASM Compiler: $CCAS 96 | 97 | CFLAGS: $CFLAGS 98 | CCASFLAGS: $CCASFLAG 99 | LDFLAGS: $LDFLAGS 100 | 101 | ================================ 102 | NCPU: $fukuro_ncpus 103 | ]) 104 | -------------------------------------------------------------------------------- /sys/i686/boot.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2024, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | 33 | #include 34 | 35 | .section .text.boot 36 | 37 | #define MULTIBOOT_FLAGS (MULTIBOOT_PAGE_ALIGN \ 38 | | MULTIBOOT_MEMORY_INFO \ 39 | | MULTIBOOT_VIDEO) 40 | 41 | #define MULTIBOOT_CHECKSUM -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_FLAGS) 42 | 43 | #define FRAMEBUFFER_WIDTH 1024 44 | #define FRAMEBUFFER_HEIGHT 768 45 | #define FRAMEBUFFER_BPP 32 46 | 47 | .align 4 48 | .long MULTIBOOT_HEADER_MAGIC 49 | .long MULTIBOOT_FLAGS 50 | .long MULTIBOOT_CHECKSUM 51 | 52 | .long 0x0 53 | .long 0x0 54 | .long 0x0 55 | .long 0x0 56 | .long 0x0 57 | 58 | /* framebuffer */ 59 | .long 0x0 60 | .long FRAMEBUFFER_WIDTH 61 | .long FRAMEBUFFER_HEIGHT 62 | .long FRAMEBUFFER_BPP 63 | 64 | .section .bss 65 | .align 16 66 | stack_bottom: 67 | .skip 4096 68 | stack_top: 69 | 70 | .section .text 71 | .globl _entry 72 | .type _entry, @function 73 | _entry: 74 | cli 75 | 76 | movl $stack_top, %esp 77 | movl $stack_bottom, %ebp 78 | 79 | pushl %ebx /* struct */ 80 | pushl %eax /* magic */ 81 | 82 | .extern unpaged_init 83 | call unpaged_init 84 | 85 | orl %eax, %eax 86 | je 1f 87 | 88 | pushl %eax 89 | 90 | .extern kmain 91 | call kmaim 92 | 93 | 1: 94 | hlt 95 | jmp 1b 96 | -------------------------------------------------------------------------------- /sys/sys/multiboot.h: -------------------------------------------------------------------------------- 1 | #ifndef FUKURO_SYS_SYS_MULTIBOOT_H 2 | # define FUKURO_SYS_SYS_MULTIBOOT_H 1 3 | 4 | # define MULTIBOOT_HEADER_MAGIC 0x1BADB002 5 | # define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 6 | 7 | # define MULTIBOOT_PAGE_ALIGN (1 << 0) 8 | # define MULTIBOOT_MEMORY_INFO (1 << 1) 9 | # define MULTIBOOT_VIDEO (1 << 2) 10 | 11 | # define MULTIBOOT_INFO_MEM (1 << 0) 12 | # define MULTIBOOT_INFO_BOOT_DEVICE (1 << 1) 13 | # define MULTIBOOT_INFO_CMDLINE (1 << 2) 14 | # define MULTIBOOT_INFO_MODS (1 << 3) 15 | # define MULTIBOOT_INFO_AOUT_SYMS (1 << 4) 16 | # define MULTIBOOT_INFO_AOUT_SHDR (1 << 5) 17 | # define MULTIBOOT_INFO_MMAP (1 << 6) 18 | # define MULTIBOOT_INFO_DRIVES (1 << 7) 19 | # define MULTIBOOT_INFO_CONFIG_TABLE (1 << 8) 20 | # define MULTIBOOT_INFO_BOOTLOADER_NAME (1 << 9) 21 | # define MULTIBOOT_INFO_APM_TABLE (1 << 10) 22 | # define MULTIBOOT_INFO_VBE (1 << 11) 23 | # define MULTIBOOT_INFO_FRAMEBUFFER (1 << 12) 24 | 25 | # ifndef __ASSEMBLER__ 26 | 27 | # include 28 | 29 | struct multiboot_aout_symbole_table 30 | { 31 | uint32_t tabsize; 32 | uint32_t strsize; 33 | uint32_t addr; 34 | uint32_t reserved; 35 | }; 36 | 37 | struct multiboot_elf_section_header_table 38 | { 39 | uint32_t num; 40 | uint32_t size; 41 | uint32_t addr; 42 | uint32_t shndx; 43 | }; 44 | 45 | struct multiboot 46 | { 47 | uint32_t flags; 48 | uint32_t mem_lower; 49 | uint32_t mem_upper; 50 | uint32_t boot_device; 51 | uint32_t cmdline; 52 | uint32_t mods_count; 53 | uint32_t mods_addr; 54 | union 55 | { 56 | struct multiboot_aout_symbole_table aout_sym; 57 | struct multiboot_elf_section_header_table elf_sec; 58 | } u; 59 | 60 | uint32_t mmap_length; 61 | uint32_t mmap_addr; 62 | uint32_t drives_length; 63 | uint32_t drives_addr; 64 | uint32_t config_table; 65 | uint32_t bootloader_name; 66 | uint32_t apm_table; 67 | 68 | uint32_t vbe_control_info; 69 | uint32_t vbe_mode_info; 70 | uint16_t vbe_mode; 71 | uint16_t vbe_interface_seg; 72 | uint16_t vbe_interface_off; 73 | uint16_t vbe_interface_len; 74 | 75 | uint64_t framebuffer_addr; 76 | uint32_t framebuffer_pitch; 77 | uint32_t framebuffer_width; 78 | uint32_t framebuffer_height; 79 | uint8_t framebuffer_bpp; 80 | uint8_t framebuffer_type; 81 | }; 82 | 83 | struct multiboot_mmap_entry 84 | { 85 | uint32_t size; 86 | uint64_t addr; 87 | uint64_t len; 88 | uint32_t type; 89 | } __attribute__((packed)); 90 | 91 | # define MULTIBOOT_MEMORY_AVAILABLE 1 92 | # define MULTIBOOT_MEMORY_RESERVED 2 93 | # define MULTIBOOT_MEMORY_ACPI 3 94 | # define MULTIBOOT_MEMORY_NVS 4 95 | # define MULTIBOOT_MEMORY_BADRAM 5 96 | 97 | # endif /* !__ASSEMBLER__ */ 98 | 99 | #endif /* !FUKURO_SYS_SYS_MULTIBOOT_H */ 100 | -------------------------------------------------------------------------------- /sys/riscv/vector.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | .section ".text" 33 | .align 4 34 | 35 | .extern kernel_trap 36 | 37 | .globl kernel_vec 38 | kernel_vec: 39 | addi sp, sp, -4 * 31 40 | 41 | sw ra, 0(sp) 42 | sw sp, 4 * 1(sp) 43 | sw gp, 4 * 2(sp) 44 | sw tp, 4 * 3(sp) 45 | sw t0, 4 * 5(sp) 46 | sw t1, 4 * 6(sp) 47 | sw t2, 4 * 7(sp) 48 | sw s0, 4 * 8(sp) 49 | sw s1, 4 * 9(sp) 50 | sw a0, 4 * 10(sp) 51 | sw a1, 4 * 11(sp) 52 | sw a2, 4 * 12(sp) 53 | sw a3, 4 * 13(sp) 54 | sw a4, 4 * 14(sp) 55 | sw a5, 4 * 15(sp) 56 | sw a6, 4 * 16(sp) 57 | sw a7, 4 * 17(sp) 58 | sw s2, 4 * 18(sp) 59 | sw s3, 4 * 19(sp) 60 | sw s4, 4 * 20(sp) 61 | sw s5, 4 * 21(sp) 62 | sw s6, 4 * 22(sp) 63 | sw s7, 4 * 23(sp) 64 | sw s8, 4 * 24(sp) 65 | sw s9, 4 * 25(sp) 66 | sw s10, 4 * 26(sp) 67 | sw s11, 4 * 27(sp) 68 | sw t3, 4 * 28(sp) 69 | sw t4, 4 * 29(sp) 70 | sw t5, 4 * 30(sp) 71 | 72 | call kernel_trap 73 | 74 | lw ra, 0(sp) 75 | lw sp, 4 * 1(sp) 76 | lw gp, 4 * 2(sp) 77 | lw tp, 4 * 3(sp) 78 | lw t0, 4 * 5(sp) 79 | lw t1, 4 * 6(sp) 80 | lw t2, 4 * 7(sp) 81 | lw s0, 4 * 8(sp) 82 | lw s1, 4 * 9(sp) 83 | lw a0, 4 * 10(sp) 84 | lw a1, 4 * 11(sp) 85 | lw a2, 4 * 12(sp) 86 | lw a3, 4 * 13(sp) 87 | lw a4, 4 * 14(sp) 88 | lw a5, 4 * 15(sp) 89 | lw a6, 4 * 16(sp) 90 | lw a7, 4 * 17(sp) 91 | lw s2, 4 * 18(sp) 92 | lw s3, 4 * 19(sp) 93 | lw s4, 4 * 20(sp) 94 | lw s5, 4 * 21(sp) 95 | lw s6, 4 * 22(sp) 96 | lw s7, 4 * 23(sp) 97 | lw s8, 4 * 24(sp) 98 | lw s9, 4 * 25(sp) 99 | lw s10, 4 * 26(sp) 100 | lw s11, 4 * 27(sp) 101 | lw t3, 4 * 28(sp) 102 | lw t4, 4 * 29(sp) 103 | lw t5, 4 * 30(sp) 104 | 105 | addi sp, sp, 4 * 31 106 | 107 | sret 108 | -------------------------------------------------------------------------------- /docs/theme/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | $projectname: $title 22 | $title 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | $treeview 42 | $search 43 | $mathjax 44 | $darkmode 45 | 46 | $extrastylesheet 47 | 48 | 49 | 50 | 51 |
52 | 53 | 54 | 55 |
56 | 57 | 58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 71 | 72 | 73 | 74 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 |
67 |
$projectname $projectnumber 68 |
69 |
$projectbrief
70 |
75 |
$projectbrief
76 |
$searchbox
$searchbox
94 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /sys/riscv/sbi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2023, d0p1 3 | * 4 | * This file is part of Fukurō. 5 | * 6 | * This software is governed by the CeCILL license under French law and 7 | * abiding by the rules of distribution of free software. You can use, 8 | * modify and/ or redistribute the software under the terms of the CeCILL 9 | * license as circulated by CEA, CNRS and INRIA at the following URL 10 | * "http://cecill.info". 11 | * 12 | * As a counterpart to the access to the source code and rights to copy, 13 | * modify and redistribute granted by the license, users are provided only 14 | * with a limited warranty and the software's author, the holder of the 15 | * economic rights, and the successive licensors have only limited 16 | * liability. 17 | * 18 | * In this respect, the user's attention is drawn to the risks associated 19 | * with loading, using, modifying and/or developing or reproducing the 20 | * software by the user in light of its specific status of free software, 21 | * that may mean that it is complicated to manipulate, and that also 22 | * therefore means that it is reserved for developers and experienced 23 | * professionals having in-depth computer knowledge. Users are therefore 24 | * encouraged to load and test the software's suitability as regards their 25 | * requirements in conditions enabling the security of their systems and/or 26 | * data to be ensured and, more generally, to use and operate it in the 27 | * same conditions as regards security. 28 | * 29 | * The fact that you are presently reading this means that you have had 30 | * knowledge of the CeCILL license and that you accept its terms. 31 | */ 32 | #ifndef FUKURO_SYS_RISCV_SBI_H 33 | # define FUKURO_SYS_RISCV_SBI_H 1 34 | 35 | # define SBI_SUCCESS 0 36 | # define SBI_ERR_FAILED -1 37 | # define SBI_ERR_NOT_SUPPORTED -2 38 | # define SBI_ERR_INVALID_PARAM -3 39 | # define SBI_ERR_DENIED -4 40 | # define SBI_ERR_INVALID_ADDRESS -5 41 | # define SBI_ERR_ALREADY_AVAILABLE -6 42 | # define SBI_ERR_ALREADY_STARTED -7 43 | # define SBI_ERR_ALREADY_STOPPED -8 44 | # define SBI_ERR_NO_SHMEM -9 45 | 46 | typedef struct 47 | { 48 | long error; 49 | long value; 50 | } SbiRet; 51 | 52 | # define SBI_EID_BASE_EXT 0x10 53 | # define SBI_FID_GET_SPEC_VERSION 0x0 54 | # define SBI_FID_GET_IMPLEM_ID 0x1 55 | # define SBI_FID_GET_IMPLEM_VERSION 0x2 56 | # define SBI_FID_PROBE_EXTENSION 0x3 57 | # define SBI_FID_GET_MACHINE_VENDOR 0x4 58 | # define SBI_FID_GET_MACHINE_ARCH 0x5 59 | # define SBI_FID_GET_MACHINE_IMPLEM 0x6 60 | 61 | enum 62 | { 63 | SBI_IMPLEM_BBL = 0, 64 | SBI_IMPLEM_OPENSBI, 65 | SBI_IMPLEM_XVISOR, 66 | SBI_IMPLEM_KVM, 67 | SBI_IMPLEM_RUSTSBI, 68 | SBI_IMPLEM_DIOSIX, 69 | SBI_IMPLEM_COFFER, 70 | SBI_IMPLEM_XEN, 71 | SBI_IMPLEM_POLAFIRE 72 | }; 73 | 74 | # define SBI_EID_LEGACY_SET_TIMER 0x00 75 | # define SBI_EID_LEGACY_PUTCHAR 0x01 76 | # define SBI_EID_LEGACY_GETCHAR 0x02 77 | # define SBI_EID_LEGACY_CLEAR_IPI 0x03 78 | # define SBI_EID_LEGACY_SHUTDOWN 0x08 79 | 80 | # define SBI_EID_TIMER_EXT 0x54494D45 81 | # define SBI_FID_SET_TIMER 0x0 82 | 83 | # define SBI_EID_DEBUG_CONSOLE_EXT 0x4442434E 84 | # define SBI_FID_CONSOLE_WRITE 0x0 85 | # define SBI_FID_CONSOLE_READ 0x1 86 | # define SBI_FID_CONSOLE_WRITE_BYTE 0x2 87 | 88 | # define SBI_EID_SYSTEM_SUSPEND_EXT 0x53555350 89 | # define SBI_FID_SYSTEM_SUSPEND 0x0 90 | 91 | inline SbiRet 92 | sbi_call(long arg0, long arg1, long arg2, long arg3, long arg4, 93 | long arg5, long fid, long eid) 94 | { 95 | SbiRet ret; 96 | register long a0 __asm__("a0") = arg0; 97 | register long a1 __asm__("a1") = arg1; 98 | register long a2 __asm__("a2") = arg2; 99 | register long a3 __asm__("a3") = arg3; 100 | register long a4 __asm__("a4") = arg4; 101 | register long a5 __asm__("a5") = arg5; 102 | register long a6 __asm__("a6") = fid; 103 | register long a7 __asm__("a7") = eid; 104 | 105 | __asm__ __volatile__("ecall" 106 | : "=r"(a0), "=r"(a1) 107 | : "r"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5), 108 | "r"(a6), "r"(a7) 109 | : "memory"); 110 | ret.error = a0; 111 | ret.value = a1; 112 | return (ret); 113 | } 114 | 115 | 116 | 117 | #endif /* !FUKURO_SYS_RISCV_SBI_H */ 118 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Fukurō Code of Conduct 2 | 3 | The Fukurō community has always worked to be a welcoming and respectful community, and we want to ensure that doesn't change as we grow and evolve. To that end, we have a few ground rules that we ask people to adhere to: 4 | 5 | - be friendly and patient, 6 | - be welcoming, 7 | - be considerate, 8 | - be respectful, 9 | - be careful in the words that you choose and be kind to others, 10 | - when we disagree, try to understand why. 11 | 12 | This isn't an exhaustive list of things that you can't do. Rather, take it in the spirit in which it's intended - a guide to make it easier to communicate and participate in the community. 13 | 14 | This code of conduct applies to all spaces managed by the Fukurō project. This includes online chat, mailing lists, bug trackers, Fukurō events such as the developer meetings and socials, and any other forums created by the project that the community uses for communication. It applies to all of your communication and conduct in these spaces, including emails, chats, things you say, slides, videos, posters, signs, or even t-shirts you display in these spaces. In addition, violations of this code outside these spaces may, in rare cases, affect a person's ability to participate within them, when the conduct amounts to an egregious violation of this code. 15 | 16 | If you believe someone is violating the code of conduct, we ask that you report it by emailing [conduct@fukuro.dev](mailto:conduct@fukuro.dev). 17 | 18 | - **Be friendly and patient.** 19 | - **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion or lack thereof, and mental and physical ability. 20 | - **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language. 21 | - **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It's important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the Fukurō community should be respectful when dealing with other members as well as with people outside the Fukurō community. 22 | - **Be careful in the words that you choose and be kind to others.** Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to: 23 | - Violent threats or language directed against another person. 24 | - Discriminatory jokes and language. 25 | - Posting sexually explicit or violent material. 26 | - Posting (or threatening to post) other people's personally identifying information ("doxing"). 27 | - Personal insults, especially those using racist or sexist terms. 28 | - Unwelcome sexual attention. 29 | - Advocating for, or encouraging, any of the above behavior. 30 | - **In general, if someone asks you to stop, then stop.** Persisting in such behavior after being asked to stop is considered harassment. 31 | - **When we disagree, try to understand why.** Disagreements, both social and technical, happen all the time and Fukurō is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we're different. The strength of Fukurō comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn't mean that they're wrong. Don't forget that it is human to err and blaming each other doesn't get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes. 32 | 33 | _(This text is based on the FreeBSD Code of Conduct, which in turn is based on the LLVM Project's draft CoC, which in turn is based on the Django Project Code of Conduct, which is in turn based on wording from the Speak Up! project.)_ 34 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Fukurō 2 | 3 | First, thanks for taking the time to contribute! :heart_eyes_cat::+1: 4 | 5 | #### Table Of Contents 6 | 7 | - [Code of Conduct](#code-of-conduct) 8 | - [How Can I Contribute?](#how-can-i-contribute-) 9 | * [Reporting Bugs](#reporting-bugs) 10 | - [Before Submitting A But Report](#before-submitting-a-but-report) 11 | - [How Do I Submit A (GOOD) Bug Report](#how-do-i-submit-a--good--bug-report-) 12 | * [Your First Code Contribution](#your-first-code-contribution) 13 | - [Styleguides](#styleguides) 14 | * [Git Commit Message](#git-commit-message) 15 | * [C Coding Style](#c-coding-style) 16 | 17 | ## Code of Conduct 18 | 19 | This project and everyone participating in it is governed by the [Fukurō Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. 20 | Please report unacceptable behavior to [conduct@fukuro.dev](mailto:conduct@fukuro.dev). 21 | 22 | ## How Can I Contribute? 23 | 24 | ### Reporting Bugs 25 | 26 | This section guide you through submitting a bug report for Fukurō. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. 27 | 28 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). 29 | 30 | > **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. 31 | 32 | #### Before Submitting A Bug Report 33 | 34 | * **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Fukuro)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. 35 | 36 | #### How Do I Submit A (GOOD) Bug Report? 37 | 38 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). 39 | 40 | Explain the problem and include additional details to help maintainers reproduce the problem: 41 | 42 | * **Use a clear and descriptive title** for the issue to identify the problem. 43 | * **Describe the exact steps which reproduce the problem** in as many details as possible. 44 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. 45 | * **Explain which behavior you expected to see instead and why.** 46 | * **Include screenshots** which clearly demonstrate the problem if needed. 47 | * **include a stack trace** 48 | * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below. 49 | 50 | Provide more context by answering these questions: 51 | 52 | * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. 53 | 54 | Include details about your configuration and environment: 55 | 56 | * **Which version of Fukurō are you using?** 57 | * **Are you running Fukurō in a virtual machine?** If so, which VM software are you using ? 58 | * **Are you running Fukurō on real hardware?** If so, provide information about it. 59 | 60 | ### Your First Code Contribution 61 | 62 | Unsure where to begin contributing to Fukurō? You can start by looking through these `beginner` and `help-wanted` issues: 63 | 64 | * [Beginner issues](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3Ahelp-wanted+repo%3Ad0p1s4m4%2FFukuro+sort%3Acomments-desc) - issues which should only require a few lines of code, and a test or two. 65 | * [Help wanted issues](https://github.com/search?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted+repo%3Ad0p1s4m4%2FFukuro+sort%3Acomments-desc+-label%3Abeginner) - issues which should be a bit more involved than `beginner` issues. 66 | 67 | Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. 68 | 69 | ## Styleguides 70 | 71 | ### Git Commit Message 72 | 73 | Git commit message **MUST** follow [Coventional Commits convention](https://www.conventionalcommits.org/en/v1.0.0/) 74 | 75 | Other recommandations: 76 | - Use the present tense ("add" instead of "added") 77 | - Use the imperative mood ("move cursor to..." not "moves cursor to...") 78 | 79 | ### C Coding Style 80 | 81 | You **MUST** follow our [coding style](http://style.d0p1.eu) 82 | 83 | --- 84 | 85 | _(This text is based on the [Atom's CONTRIBUTING.md](https://github.com/atom/atom/blob/master/CONTRIBUTING.md))_ 86 | -------------------------------------------------------------------------------- /tools/setup-toolchain: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright © 2023, d0p1 3 | # 4 | # This file is part of Fukurō. 5 | # 6 | # This software is governed by the CeCILL license under French law and 7 | # abiding by the rules of distribution of free software. You can use, 8 | # modify and/ or redistribute the software under the terms of the CeCILL 9 | # license as circulated by CEA, CNRS and INRIA at the following URL 10 | # "http://cecill.info". 11 | # 12 | # As a counterpart to the access to the source code and rights to copy, 13 | # modify and redistribute granted by the license, users are provided only 14 | # with a limited warranty and the software's author, the holder of the 15 | # economic rights, and the successive licensors have only limited 16 | # liability. 17 | # 18 | # In this respect, the user's attention is drawn to the risks associated 19 | # with loading, using, modifying and/or developing or reproducing the 20 | # software by the user in light of its specific status of free software, 21 | # that may mean that it is complicated to manipulate, and that also 22 | # therefore means that it is reserved for developers and experienced 23 | # professionals having in-depth computer knowledge. Users are therefore 24 | # encouraged to load and test the software's suitability as regards their 25 | # requirements in conditions enabling the security of their systems and/or 26 | # data to be ensured and, more generally, to use and operate it in the 27 | # same conditions as regards security. 28 | # 29 | # The fact that you are presently reading this means that you have had 30 | # knowledge of the CeCILL license and that you accept its terms. 31 | 32 | set -o errexit 33 | set -o nounset 34 | set -o pipefail 35 | 36 | BINUTILS_VERSION=2.41 37 | BINUTILS_ARCHIVE="binutils-${BINUTILS_VERSION}.tar.gz" 38 | BINUTILS_URL="https://ftp.gnu.org/gnu/binutils/${BINUTILS_ARCHIVE}" 39 | BINUTILS_SHA256="48d00a8dc73aa7d2394a7dc069b96191d95e8de8f0da6dc91da5cce655c20e45" 40 | 41 | GCC_VERSION=13.2.0 42 | GCC_ARCHIVE="gcc-${GCC_VERSION}.tar.gz" 43 | GCC_URL="https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/${GCC_ARCHIVE}" 44 | GCC_SHA256="8cb4be3796651976f94b9356fa08d833524f62420d6292c5033a9a26af315078" 45 | 46 | cerror="\033[31m" 47 | cwarn="\033[33m" 48 | cok="\033[32m" 49 | creset="\033[0m" 50 | 51 | target_triple=riscv-elf 52 | install_prefix="${HOME}/.toolchain" 53 | do_sha256_check=yes 54 | do_force=no 55 | do_update=no 56 | do_build_binutils=no 57 | do_build_gcc=no 58 | 59 | warn() { 60 | printf "[${cwarn}WARN${creset}] %s\n" "$1" 61 | } 62 | 63 | fatal() { 64 | printf "[${cerror}FATAL${creset}] %s\n" "$1" 65 | exit 255 66 | } 67 | 68 | finish() { 69 | if [ -d "${install_prefix}/build" ]; then 70 | ( 71 | cd "${install_prefix}/build" 72 | rm -rf "binutils-${BINUTILS_VERSION}" 73 | rm -rf "gcc-${GCC_VERSION}" 74 | ) 75 | fi 76 | } 77 | trap finish EXIT ERR 78 | 79 | setup() { 80 | wget_exe=`which wget` 81 | curl_exe=`which curl` 82 | sha256sum_exe=`which sha256sum` 83 | 84 | if [ x"$sha256sum_exe" = "x" ]; then 85 | warn "sha256sum not found; sha256 check will be skipped" 86 | do_sha256_check=no 87 | fi 88 | } 89 | 90 | verify() { 91 | printf "checking %s sha256 hash... " "$1" 92 | if [ x"$do_sha256_check" = "xyes" ]; then 93 | sha256sum -c <(printf "%s %s\n" "$2" "$1") > /dev/null && printf "${cok}OK${creset}\n" || (printf "${cerror}FAILED${creset}\n" && false) 94 | else 95 | printf "${cwarn}SKIP${creset}\n" 96 | fi 97 | } 98 | 99 | check_current_binutils_version() { 100 | printf "checking binutils version... " 101 | if "${target_triple}-ld" --version | grep "${BINUTILS_VERSION}" >/dev/null; then 102 | printf "${cok}OK${creset}\n" 103 | else 104 | printf "${cwarn}MISSMATCH${creset}\n" 105 | if [ x"$do_update" = "xyes" ]; then 106 | do_build_binutils=yes 107 | fi 108 | fi 109 | } 110 | 111 | check_current_binutils() { 112 | printf "checking for %s-ld... " "${target_triple}" 113 | if command -v "${target_triple}-ld" > /dev/null; then 114 | printf "${cok}FOUND${creset}\n" 115 | 116 | check_current_binutils_version 117 | else 118 | printf "${cerror}NO${creset}\n" 119 | do_build_binutils=yes 120 | fi 121 | } 122 | 123 | check_current_gcc_version() { 124 | printf "checking gcc version... " 125 | if "${target_triple}-gcc" --version | grep "${GCC_VERSION}" >/dev/null; then 126 | printf "${cok}OK${creset}\n" 127 | else 128 | printf "${cwarn}MISSMATCH${creset}\n" 129 | if [ x"$do_update" = "xyes" ]; then 130 | do_build_gcc=yes 131 | fi 132 | fi 133 | } 134 | 135 | check_current_gcc() { 136 | printf "checking for %s-gcc... " "${target_triple}" 137 | if command -v "${target_triple}-gcc" > /dev/null; then 138 | printf "${cok}FOUND${creset}\n" 139 | 140 | check_current_gcc_version 141 | else 142 | printf "${cerror}NO${creset}\n" 143 | do_build_gcc=yes 144 | fi 145 | } 146 | 147 | download() { 148 | for i in 1 2 3; do 149 | if [ ! -f "$1" ]; then 150 | $wget_exe -O "$1" "$2" 151 | fi 152 | 153 | if verify "$1" "$3"; then 154 | break 155 | else 156 | rm "$1" 157 | fi 158 | done 159 | 160 | test -f "$1" 161 | } 162 | 163 | build_binutils() { 164 | ( 165 | cd "${install_prefix}/build" 166 | download "${BINUTILS_ARCHIVE}" "${BINUTILS_URL}" "${BINUTILS_SHA256}" 167 | 168 | printf "extract %s\n" "${BINUTILS_ARCHIVE}" 169 | tar -xf "${BINUTILS_ARCHIVE}" 170 | ( 171 | cd "binutils-${BINUTILS_VERSION}" 172 | mkdir -p build 173 | ( 174 | cd build 175 | ../configure --target="${target_triple}" --prefix="${install_prefix}" --with-sysroot --disable-nls --disable-werror 176 | make -j $(nproc) 177 | make install 178 | ) 179 | ) 180 | ) 181 | } 182 | 183 | build_gcc() { 184 | ( 185 | cd "${install_prefix}/build" 186 | download "${GCC_ARCHIVE}" "${GCC_URL}" "${GCC_SHA256}" 187 | 188 | printf "extract %s\n" "${GCC_ARCHIVE}" 189 | tar -xf "${GCC_ARCHIVE}" 190 | ( 191 | cd "gcc-${GCC_VERSION}" 192 | mkdir -p build 193 | ( 194 | cd build 195 | ../configure --target="${target_triple}" --prefix="${install_prefix}" --with-sysroot --disable-nls --enable-languages=c --with-newlib 196 | make -j $(nproc) all-gcc 197 | make -j $(nproc) all-target-libgcc 198 | make -j $(nproc) install-gcc 199 | make -j $(nproc) install-target-libgcc 200 | ) 201 | ) 202 | ) 203 | } 204 | 205 | usage() { 206 | cat <][-p ][-f][-h] 208 | 209 | -t toolchain triple (default: $target_triple) 210 | -p install prefix path (default: $install_prefix) 211 | -f force rebuild (eg: ignore cache when CI build) 212 | -u update if toolchain version missmatch (default: no) 213 | -h display this help and exit 214 | 215 | Report bugs to: 216 | EOF 217 | 218 | exit 0 219 | } 220 | 221 | main() { 222 | setup 223 | 224 | while getopts 't:p:fh' opt; do 225 | case "$opt" in 226 | t) 227 | target_triple="${OPTARG}" 228 | ;; 229 | p) 230 | install_target="${OPTARG%%/}" 231 | ;; 232 | f) 233 | do_force=yes 234 | ;; 235 | u) 236 | do_update=yes 237 | ;; 238 | ?|h) 239 | usage "${@}" 240 | ;; 241 | esac 242 | done 243 | 244 | PATH="${install_prefix}/bin:${PATH}" 245 | mkdir -p "${install_prefix}/build" 246 | 247 | if [ x"$do_force" = "xyes" ]; then 248 | do_build_binutils=yes 249 | do_build_gcc=yes 250 | else 251 | check_current_binutils 252 | check_current_gcc 253 | fi 254 | 255 | if [ x"$do_build_binutils" = "xyes" ]; then 256 | build_binutils 257 | fi 258 | 259 | if [ x"$do_build_gcc" = "xyes" ]; then 260 | build_gcc 261 | fi 262 | } 263 | 264 | main "${@}" 265 | -------------------------------------------------------------------------------- /docs/theme/doxygen-awesome-darkmode-toggle.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Doxygen Awesome 4 | https://github.com/jothepro/doxygen-awesome-css 5 | 6 | MIT License 7 | 8 | Copyright (c) 2021 - 2023 jothepro 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | class DoxygenAwesomeDarkModeToggle extends HTMLElement { 31 | // SVG icons from https://fonts.google.com/icons 32 | // Licensed under the Apache 2.0 license: 33 | // https://www.apache.org/licenses/LICENSE-2.0.html 34 | static lightModeIcon = `` 35 | static darkModeIcon = `` 36 | static title = "Toggle Light/Dark Mode" 37 | 38 | static prefersLightModeInDarkModeKey = "prefers-light-mode-in-dark-mode" 39 | static prefersDarkModeInLightModeKey = "prefers-dark-mode-in-light-mode" 40 | 41 | static _staticConstructor = function() { 42 | DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.userPreference) 43 | // Update the color scheme when the browsers preference changes 44 | // without user interaction on the website. 45 | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => { 46 | DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged() 47 | }) 48 | // Update the color scheme when the tab is made visible again. 49 | // It is possible that the appearance was changed in another tab 50 | // while this tab was in the background. 51 | document.addEventListener("visibilitychange", visibilityState => { 52 | if (document.visibilityState === 'visible') { 53 | DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged() 54 | } 55 | }); 56 | }() 57 | 58 | static init() { 59 | $(function() { 60 | $(document).ready(function() { 61 | const toggleButton = document.createElement('doxygen-awesome-dark-mode-toggle') 62 | toggleButton.title = DoxygenAwesomeDarkModeToggle.title 63 | toggleButton.updateIcon() 64 | 65 | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => { 66 | toggleButton.updateIcon() 67 | }) 68 | document.addEventListener("visibilitychange", visibilityState => { 69 | if (document.visibilityState === 'visible') { 70 | toggleButton.updateIcon() 71 | } 72 | }); 73 | 74 | $(document).ready(function(){ 75 | document.getElementById("MSearchBox").parentNode.appendChild(toggleButton) 76 | }) 77 | $(window).resize(function(){ 78 | document.getElementById("MSearchBox").parentNode.appendChild(toggleButton) 79 | }) 80 | }) 81 | }) 82 | } 83 | 84 | constructor() { 85 | super(); 86 | this.onclick=this.toggleDarkMode 87 | } 88 | 89 | /** 90 | * @returns `true` for dark-mode, `false` for light-mode system preference 91 | */ 92 | static get systemPreference() { 93 | return window.matchMedia('(prefers-color-scheme: dark)').matches 94 | } 95 | 96 | /** 97 | * @returns `true` for dark-mode, `false` for light-mode user preference 98 | */ 99 | static get userPreference() { 100 | return (!DoxygenAwesomeDarkModeToggle.systemPreference && localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey)) || 101 | (DoxygenAwesomeDarkModeToggle.systemPreference && !localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey)) 102 | } 103 | 104 | static set userPreference(userPreference) { 105 | DoxygenAwesomeDarkModeToggle.darkModeEnabled = userPreference 106 | if(!userPreference) { 107 | if(DoxygenAwesomeDarkModeToggle.systemPreference) { 108 | localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey, true) 109 | } else { 110 | localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey) 111 | } 112 | } else { 113 | if(!DoxygenAwesomeDarkModeToggle.systemPreference) { 114 | localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey, true) 115 | } else { 116 | localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey) 117 | } 118 | } 119 | DoxygenAwesomeDarkModeToggle.onUserPreferenceChanged() 120 | } 121 | 122 | static enableDarkMode(enable) { 123 | if(enable) { 124 | DoxygenAwesomeDarkModeToggle.darkModeEnabled = true 125 | document.documentElement.classList.add("dark-mode") 126 | document.documentElement.classList.remove("light-mode") 127 | } else { 128 | DoxygenAwesomeDarkModeToggle.darkModeEnabled = false 129 | document.documentElement.classList.remove("dark-mode") 130 | document.documentElement.classList.add("light-mode") 131 | } 132 | } 133 | 134 | static onSystemPreferenceChanged() { 135 | DoxygenAwesomeDarkModeToggle.darkModeEnabled = DoxygenAwesomeDarkModeToggle.userPreference 136 | DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled) 137 | } 138 | 139 | static onUserPreferenceChanged() { 140 | DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled) 141 | } 142 | 143 | toggleDarkMode() { 144 | DoxygenAwesomeDarkModeToggle.userPreference = !DoxygenAwesomeDarkModeToggle.userPreference 145 | this.updateIcon() 146 | } 147 | 148 | updateIcon() { 149 | if(DoxygenAwesomeDarkModeToggle.darkModeEnabled) { 150 | this.innerHTML = DoxygenAwesomeDarkModeToggle.darkModeIcon 151 | } else { 152 | this.innerHTML = DoxygenAwesomeDarkModeToggle.lightModeIcon 153 | } 154 | } 155 | } 156 | 157 | customElements.define("doxygen-awesome-dark-mode-toggle", DoxygenAwesomeDarkModeToggle); 158 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL 3 | 4 | Version 2.1 du 2013-06-21 5 | 6 | 7 | Avertissement 8 | 9 | Ce contrat est une licence de logiciel libre issue d'une concertation 10 | entre ses auteurs afin que le respect de deux grands principes préside à 11 | sa rédaction: 12 | 13 | * d'une part, le respect des principes de diffusion des logiciels 14 | libres: accès au code source, droits étendus conférés aux utilisateurs, 15 | * d'autre part, la désignation d'un droit applicable, le droit 16 | français, auquel elle est conforme, tant au regard du droit de la 17 | responsabilité civile que du droit de la propriété intellectuelle et 18 | de la protection qu'il offre aux auteurs et titulaires des droits 19 | patrimoniaux sur un logiciel. 20 | 21 | Les auteurs de la licence CeCILL (Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) 22 | sont: 23 | 24 | Commissariat à l'énergie atomique et aux énergies alternatives - CEA, 25 | établissement public de recherche à caractère scientifique, technique et 26 | industriel, dont le siège est situé 25 rue Leblanc, immeuble Le Ponant 27 | D, 75015 Paris. 28 | 29 | Centre National de la Recherche Scientifique - CNRS, établissement 30 | public à caractère scientifique et technologique, dont le siège est 31 | situé 3 rue Michel-Ange, 75794 Paris cedex 16. 32 | 33 | Institut National de Recherche en Informatique et en Automatique - 34 | Inria, établissement public à caractère scientifique et technologique, 35 | dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153 36 | Le Chesnay cedex. 37 | 38 | 39 | Préambule 40 | 41 | Ce contrat est une licence de logiciel libre dont l'objectif est de 42 | conférer aux utilisateurs la liberté de modification et de 43 | redistribution du logiciel régi par cette licence dans le cadre d'un 44 | modèle de diffusion en logiciel libre. 45 | 46 | L'exercice de ces libertés est assorti de certains devoirs à la charge 47 | des utilisateurs afin de préserver ce statut au cours des 48 | redistributions ultérieures. 49 | 50 | L'accessibilité au code source et les droits de copie, de modification 51 | et de redistribution qui en découlent ont pour contrepartie de n'offrir 52 | aux utilisateurs qu'une garantie limitée et de ne faire peser sur 53 | l'auteur du logiciel, le titulaire des droits patrimoniaux et les 54 | concédants successifs qu'une responsabilité restreinte. 55 | 56 | A cet égard l'attention de l'utilisateur est attirée sur les risques 57 | associés au chargement, à l'utilisation, à la modification et/ou au 58 | développement et à la reproduction du logiciel par l'utilisateur étant 59 | donné sa spécificité de logiciel libre, qui peut le rendre complexe à 60 | manipuler et qui le réserve donc à des développeurs ou des 61 | professionnels avertis possédant des connaissances informatiques 62 | approfondies. Les utilisateurs sont donc invités à charger et tester 63 | l'adéquation du logiciel à leurs besoins dans des conditions permettant 64 | d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus 65 | généralement, à l'utiliser et l'exploiter dans les mêmes conditions de 66 | sécurité. Ce contrat peut être reproduit et diffusé librement, sous 67 | réserve de le conserver en l'état, sans ajout ni suppression de clauses. 68 | 69 | Ce contrat est susceptible de s'appliquer à tout logiciel dont le 70 | titulaire des droits patrimoniaux décide de soumettre l'exploitation aux 71 | dispositions qu'il contient. 72 | 73 | Une liste de questions fréquemment posées se trouve sur le site web 74 | officiel de la famille des licences CeCILL 75 | (http://www.cecill.info/index.fr.html) pour toute clarification qui 76 | serait nécessaire. 77 | 78 | 79 | Article 1 - DEFINITIONS 80 | 81 | Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une 82 | lettre capitale, auront la signification suivante: 83 | 84 | Contrat: désigne le présent contrat de licence, ses éventuelles versions 85 | postérieures et annexes. 86 | 87 | Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code 88 | Source et le cas échéant sa documentation, dans leur état au moment de 89 | l'acceptation du Contrat par le Licencié. 90 | 91 | Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et 92 | éventuellement de Code Objet et le cas échéant sa documentation, dans 93 | leur état au moment de leur première diffusion sous les termes du Contrat. 94 | 95 | Logiciel Modifié: désigne le Logiciel modifié par au moins une 96 | Contribution. 97 | 98 | Code Source: désigne l'ensemble des instructions et des lignes de 99 | programme du Logiciel et auquel l'accès est nécessaire en vue de 100 | modifier le Logiciel. 101 | 102 | Code Objet: désigne les fichiers binaires issus de la compilation du 103 | Code Source. 104 | 105 | Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur 106 | sur le Logiciel Initial. 107 | 108 | Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le 109 | Contrat. 110 | 111 | Contributeur: désigne le Licencié auteur d'au moins une Contribution. 112 | 113 | Concédant: désigne le Titulaire ou toute personne physique ou morale 114 | distribuant le Logiciel sous le Contrat. 115 | 116 | Contribution: désigne l'ensemble des modifications, corrections, 117 | traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans 118 | le Logiciel par tout Contributeur, ainsi que tout Module Interne. 119 | 120 | Module: désigne un ensemble de fichiers sources y compris leur 121 | documentation qui permet de réaliser des fonctionnalités ou services 122 | supplémentaires à ceux fournis par le Logiciel. 123 | 124 | Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce 125 | Module et le Logiciel s'exécutent dans des espaces d'adressage 126 | différents, l'un appelant l'autre au moment de leur exécution. 127 | 128 | Module Interne: désigne tout Module lié au Logiciel de telle sorte 129 | qu'ils s'exécutent dans le même espace d'adressage. 130 | 131 | GNU GPL: désigne la GNU General Public License dans sa version 2 ou 132 | toute version ultérieure, telle que publiée par Free Software Foundation 133 | Inc. 134 | 135 | GNU Affero GPL: désigne la GNU Affero General Public License dans sa 136 | version 3 ou toute version ultérieure, telle que publiée par Free 137 | Software Foundation Inc. 138 | 139 | EUPL: désigne la Licence Publique de l'Union européenne dans sa version 140 | 1.1 ou toute version ultérieure, telle que publiée par la Commission 141 | Européenne. 142 | 143 | Parties: désigne collectivement le Licencié et le Concédant. 144 | 145 | Ces termes s'entendent au singulier comme au pluriel. 146 | 147 | 148 | Article 2 - OBJET 149 | 150 | Le Contrat a pour objet la concession par le Concédant au Licencié d'une 151 | licence non exclusive, cessible et mondiale du Logiciel telle que 152 | définie ci-après à l'article 5 <#etendue> pour toute la durée de 153 | protection des droits portant sur ce Logiciel. 154 | 155 | 156 | Article 3 - ACCEPTATION 157 | 158 | 3.1 L'acceptation par le Licencié des termes du Contrat est réputée 159 | acquise du fait du premier des faits suivants: 160 | 161 | * (i) le chargement du Logiciel par tout moyen notamment par 162 | téléchargement à partir d'un serveur distant ou par chargement à 163 | partir d'un support physique; 164 | * (ii) le premier exercice par le Licencié de l'un quelconque des 165 | droits concédés par le Contrat. 166 | 167 | 3.2 Un exemplaire du Contrat, contenant notamment un avertissement 168 | relatif aux spécificités du Logiciel, à la restriction de garantie et à 169 | la limitation à un usage par des utilisateurs expérimentés a été mis à 170 | disposition du Licencié préalablement à son acceptation telle que 171 | définie à l'article 3.1 <#acceptation-acquise> ci dessus et le Licencié 172 | reconnaît en avoir pris connaissance. 173 | 174 | 175 | Article 4 - ENTREE EN VIGUEUR ET DUREE 176 | 177 | 178 | 4.1 ENTREE EN VIGUEUR 179 | 180 | Le Contrat entre en vigueur à la date de son acceptation par le Licencié 181 | telle que définie en 3.1 <#acceptation-acquise>. 182 | 183 | 184 | 4.2 DUREE 185 | 186 | Le Contrat produira ses effets pendant toute la durée légale de 187 | protection des droits patrimoniaux portant sur le Logiciel. 188 | 189 | 190 | Article 5 - ETENDUE DES DROITS CONCEDES 191 | 192 | Le Concédant concède au Licencié, qui accepte, les droits suivants sur 193 | le Logiciel pour toutes destinations et pour la durée du Contrat dans 194 | les conditions ci-après détaillées. 195 | 196 | Par ailleurs, si le Concédant détient ou venait à détenir un ou 197 | plusieurs brevets d'invention protégeant tout ou partie des 198 | fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas 199 | opposer les éventuels droits conférés par ces brevets aux Licenciés 200 | successifs qui utiliseraient, exploiteraient ou modifieraient le 201 | Logiciel. En cas de cession de ces brevets, le Concédant s'engage à 202 | faire reprendre les obligations du présent alinéa aux cessionnaires. 203 | 204 | 205 | 5.1 DROIT D'UTILISATION 206 | 207 | Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant 208 | aux domaines d'application, étant ci-après précisé que cela comporte: 209 | 210 | 1. 211 | 212 | la reproduction permanente ou provisoire du Logiciel en tout ou 213 | partie par tout moyen et sous toute forme. 214 | 215 | 2. 216 | 217 | le chargement, l'affichage, l'exécution, ou le stockage du Logiciel 218 | sur tout support. 219 | 220 | 3. 221 | 222 | la possibilité d'en observer, d'en étudier, ou d'en tester le 223 | fonctionnement afin de déterminer les idées et principes qui sont à 224 | la base de n'importe quel élément de ce Logiciel; et ceci, lorsque 225 | le Licencié effectue toute opération de chargement, d'affichage, 226 | d'exécution, de transmission ou de stockage du Logiciel qu'il est en 227 | droit d'effectuer en vertu du Contrat. 228 | 229 | 230 | 5.2 DROIT D'APPORTER DES CONTRIBUTIONS 231 | 232 | Le droit d'apporter des Contributions comporte le droit de traduire, 233 | d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel 234 | et le droit de reproduire le logiciel en résultant. 235 | 236 | Le Licencié est autorisé à apporter toute Contribution au Logiciel sous 237 | réserve de mentionner, de façon explicite, son nom en tant qu'auteur de 238 | cette Contribution et la date de création de celle-ci. 239 | 240 | 241 | 5.3 DROIT DE DISTRIBUTION 242 | 243 | Le droit de distribution comporte notamment le droit de diffuser, de 244 | transmettre et de communiquer le Logiciel au public sur tout support et 245 | par tout moyen ainsi que le droit de mettre sur le marché à titre 246 | onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé. 247 | 248 | Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou 249 | non, à des tiers dans les conditions ci-après détaillées. 250 | 251 | 252 | 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION 253 | 254 | Le Licencié est autorisé à distribuer des copies conformes du Logiciel, 255 | sous forme de Code Source ou de Code Objet, à condition que cette 256 | distribution respecte les dispositions du Contrat dans leur totalité et 257 | soit accompagnée: 258 | 259 | 1. 260 | 261 | d'un exemplaire du Contrat, 262 | 263 | 2. 264 | 265 | d'un avertissement relatif à la restriction de garantie et de 266 | responsabilité du Concédant telle que prévue aux articles 8 267 | <#responsabilite> et 9 <#garantie>, 268 | 269 | et que, dans le cas où seul le Code Objet du Logiciel est redistribué, 270 | le Licencié permette un accès effectif au Code Source complet du 271 | Logiciel pour une durée d'au moins 3 ans à compter de la distribution du 272 | logiciel, étant entendu que le coût additionnel d'acquisition du Code 273 | Source ne devra pas excéder le simple coût de transfert des données. 274 | 275 | 276 | 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE 277 | 278 | Lorsque le Licencié apporte une Contribution au Logiciel, les conditions 279 | de distribution du Logiciel Modifié en résultant sont alors soumises à 280 | l'intégralité des dispositions du Contrat. 281 | 282 | Le Licencié est autorisé à distribuer le Logiciel Modifié, sous forme de 283 | code source ou de code objet, à condition que cette distribution 284 | respecte les dispositions du Contrat dans leur totalité et soit 285 | accompagnée: 286 | 287 | 1. 288 | 289 | d'un exemplaire du Contrat, 290 | 291 | 2. 292 | 293 | d'un avertissement relatif à la restriction de garantie et de 294 | responsabilité du Concédant telle que prévue aux articles 8 295 | <#responsabilite> et 9 <#garantie>, 296 | 297 | et, dans le cas où seul le code objet du Logiciel Modifié est redistribué, 298 | 299 | 3. 300 | 301 | d'une note précisant les conditions d'accès effectif au code source 302 | complet du Logiciel Modifié, pendant une période d'au moins 3 ans à 303 | compter de la distribution du Logiciel Modifié, étant entendu que le 304 | coût additionnel d'acquisition du code source ne devra pas excéder 305 | le simple coût de transfert des données. 306 | 307 | 308 | 5.3.3 DISTRIBUTION DES MODULES EXTERNES 309 | 310 | Lorsque le Licencié a développé un Module Externe les conditions du 311 | Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué 312 | sous un contrat de licence différent. 313 | 314 | 315 | 5.3.4 COMPATIBILITE AVEC D'AUTRES LICENCES 316 | 317 | Le Licencié peut inclure un code soumis aux dispositions d'une des 318 | versions de la licence GNU GPL, GNU Affero GPL et/ou EUPL dans le 319 | Logiciel modifié ou non et distribuer l'ensemble sous les conditions de 320 | la même version de la licence GNU GPL, GNU Affero GPL et/ou EUPL. 321 | 322 | Le Licencié peut inclure le Logiciel modifié ou non dans un code soumis 323 | aux dispositions d'une des versions de la licence GNU GPL, GNU Affero 324 | GPL et/ou EUPL et distribuer l'ensemble sous les conditions de la même 325 | version de la licence GNU GPL, GNU Affero GPL et/ou EUPL. 326 | 327 | 328 | Article 6 - PROPRIETE INTELLECTUELLE 329 | 330 | 331 | 6.1 SUR LE LOGICIEL INITIAL 332 | 333 | Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel 334 | Initial. Toute utilisation du Logiciel Initial est soumise au respect 335 | des conditions dans lesquelles le Titulaire a choisi de diffuser son 336 | oeuvre et nul autre n'a la faculté de modifier les conditions de 337 | diffusion de ce Logiciel Initial. 338 | 339 | Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi 340 | par le Contrat et ce, pour la durée visée à l'article 4.2 <#duree>. 341 | 342 | 343 | 6.2 SUR LES CONTRIBUTIONS 344 | 345 | Le Licencié qui a développé une Contribution est titulaire sur celle-ci 346 | des droits de propriété intellectuelle dans les conditions définies par 347 | la législation applicable. 348 | 349 | 350 | 6.3 SUR LES MODULES EXTERNES 351 | 352 | Le Licencié qui a développé un Module Externe est titulaire sur celui-ci 353 | des droits de propriété intellectuelle dans les conditions définies par 354 | la législation applicable et reste libre du choix du contrat régissant 355 | sa diffusion. 356 | 357 | 358 | 6.4 DISPOSITIONS COMMUNES 359 | 360 | Le Licencié s'engage expressément: 361 | 362 | 1. 363 | 364 | à ne pas supprimer ou modifier de quelque manière que ce soit les 365 | mentions de propriété intellectuelle apposées sur le Logiciel; 366 | 367 | 2. 368 | 369 | à reproduire à l'identique lesdites mentions de propriété 370 | intellectuelle sur les copies du Logiciel modifié ou non. 371 | 372 | Le Licencié s'engage à ne pas porter atteinte, directement ou 373 | indirectement, aux droits de propriété intellectuelle du Titulaire et/ou 374 | des Contributeurs sur le Logiciel et à prendre, le cas échéant, à 375 | l'égard de son personnel toutes les mesures nécessaires pour assurer le 376 | respect des dits droits de propriété intellectuelle du Titulaire et/ou 377 | des Contributeurs. 378 | 379 | 380 | Article 7 - SERVICES ASSOCIES 381 | 382 | 7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de 383 | prestations d'assistance technique ou de maintenance du Logiciel. 384 | 385 | Cependant le Concédant reste libre de proposer ce type de services. Les 386 | termes et conditions d'une telle assistance technique et/ou d'une telle 387 | maintenance seront alors déterminés dans un acte séparé. Ces actes de 388 | maintenance et/ou assistance technique n'engageront que la seule 389 | responsabilité du Concédant qui les propose. 390 | 391 | 7.2 De même, tout Concédant est libre de proposer, sous sa seule 392 | responsabilité, à ses licenciés une garantie, qui n'engagera que lui, 393 | lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce, 394 | dans les conditions qu'il souhaite. Cette garantie et les modalités 395 | financières de son application feront l'objet d'un acte séparé entre le 396 | Concédant et le Licencié. 397 | 398 | 399 | Article 8 - RESPONSABILITE 400 | 401 | 8.1 Sous réserve des dispositions de l'article 8.2 402 | <#limite-responsabilite>, le Licencié a la faculté, sous réserve de 403 | prouver la faute du Concédant concerné, de solliciter la réparation du 404 | préjudice direct qu'il subirait du fait du Logiciel et dont il apportera 405 | la preuve. 406 | 407 | 8.2 La responsabilité du Concédant est limitée aux engagements pris en 408 | application du Contrat et ne saurait être engagée en raison notamment: 409 | (i) des dommages dus à l'inexécution, totale ou partielle, de ses 410 | obligations par le Licencié, (ii) des dommages directs ou indirects 411 | découlant de l'utilisation ou des performances du Logiciel subis par le 412 | Licencié et (iii) plus généralement d'un quelconque dommage indirect. En 413 | particulier, les Parties conviennent expressément que tout préjudice 414 | financier ou commercial (par exemple perte de données, perte de 415 | bénéfices, perte d'exploitation, perte de clientèle ou de commandes, 416 | manque à gagner, trouble commercial quelconque) ou toute action dirigée 417 | contre le Licencié par un tiers, constitue un dommage indirect et 418 | n'ouvre pas droit à réparation par le Concédant. 419 | 420 | 421 | Article 9 - GARANTIE 422 | 423 | 9.1 Le Licencié reconnaît que l'état actuel des connaissances 424 | scientifiques et techniques au moment de la mise en circulation du 425 | Logiciel ne permet pas d'en tester et d'en vérifier toutes les 426 | utilisations ni de détecter l'existence d'éventuels défauts. L'attention 427 | du Licencié a été attirée sur ce point sur les risques associés au 428 | chargement, à l'utilisation, la modification et/ou au développement et à 429 | la reproduction du Logiciel qui sont réservés à des utilisateurs avertis. 430 | 431 | Il relève de la responsabilité du Licencié de contrôler, par tous 432 | moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et 433 | de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens. 434 | 435 | 9.2 Le Concédant déclare de bonne foi être en droit de concéder 436 | l'ensemble des droits attachés au Logiciel (comprenant notamment les 437 | droits visés à l'article 5 <#etendue>). 438 | 439 | 9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le 440 | Concédant sans autre garantie, expresse ou tacite, que celle prévue à 441 | l'article 9.2 <#bonne-foi> et notamment sans aucune garantie sur sa 442 | valeur commerciale, son caractère sécurisé, innovant ou pertinent. 443 | 444 | En particulier, le Concédant ne garantit pas que le Logiciel est exempt 445 | d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible 446 | avec l'équipement du Licencié et sa configuration logicielle ni qu'il 447 | remplira les besoins du Licencié. 448 | 449 | 9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le 450 | Logiciel ne porte pas atteinte à un quelconque droit de propriété 451 | intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout 452 | autre droit de propriété. Ainsi, le Concédant exclut toute garantie au 453 | profit du Licencié contre les actions en contrefaçon qui pourraient être 454 | diligentées au titre de l'utilisation, de la modification, et de la 455 | redistribution du Logiciel. Néanmoins, si de telles actions sont 456 | exercées contre le Licencié, le Concédant lui apportera son expertise 457 | technique et juridique pour sa défense. Cette expertise technique et 458 | juridique est déterminée au cas par cas entre le Concédant concerné et 459 | le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage 460 | toute responsabilité quant à l'utilisation de la dénomination du 461 | Logiciel par le Licencié. Aucune garantie n'est apportée quant à 462 | l'existence de droits antérieurs sur le nom du Logiciel et sur 463 | l'existence d'une marque. 464 | 465 | 466 | Article 10 - RESILIATION 467 | 468 | 10.1 En cas de manquement par le Licencié aux obligations mises à sa 469 | charge par le Contrat, le Concédant pourra résilier de plein droit le 470 | Contrat trente (30) jours après notification adressée au Licencié et 471 | restée sans effet. 472 | 473 | 10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à 474 | utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les 475 | licences qu'il aura concédées antérieurement à la résiliation du Contrat 476 | resteront valides sous réserve qu'elles aient été effectuées en 477 | conformité avec le Contrat. 478 | 479 | 480 | Article 11 - DISPOSITIONS DIVERSES 481 | 482 | 483 | 11.1 CAUSE EXTERIEURE 484 | 485 | Aucune des Parties ne sera responsable d'un retard ou d'une défaillance 486 | d'exécution du Contrat qui serait dû à un cas de force majeure, un cas 487 | fortuit ou une cause extérieure, telle que, notamment, le mauvais 488 | fonctionnement ou les interruptions du réseau électrique ou de 489 | télécommunication, la paralysie du réseau liée à une attaque 490 | informatique, l'intervention des autorités gouvernementales, les 491 | catastrophes naturelles, les dégâts des eaux, les tremblements de terre, 492 | le feu, les explosions, les grèves et les conflits sociaux, l'état de 493 | guerre... 494 | 495 | 11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou 496 | plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du 497 | Contrat, ne pourra en aucun cas impliquer renonciation par la Partie 498 | intéressée à s'en prévaloir ultérieurement. 499 | 500 | 11.3 Le Contrat annule et remplace toute convention antérieure, écrite 501 | ou orale, entre les Parties sur le même objet et constitue l'accord 502 | entier entre les Parties sur cet objet. Aucune addition ou modification 503 | aux termes du Contrat n'aura d'effet à l'égard des Parties à moins 504 | d'être faite par écrit et signée par leurs représentants dûment habilités. 505 | 506 | 11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat 507 | s'avèrerait contraire à une loi ou à un texte applicable, existants ou 508 | futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les 509 | amendements nécessaires pour se conformer à cette loi ou à ce texte. 510 | Toutes les autres dispositions resteront en vigueur. De même, la 511 | nullité, pour quelque raison que ce soit, d'une des dispositions du 512 | Contrat ne saurait entraîner la nullité de l'ensemble du Contrat. 513 | 514 | 515 | 11.5 LANGUE 516 | 517 | Le Contrat est rédigé en langue française et en langue anglaise, ces 518 | deux versions faisant également foi. 519 | 520 | 521 | Article 12 - NOUVELLES VERSIONS DU CONTRAT 522 | 523 | 12.1 Toute personne est autorisée à copier et distribuer des copies de 524 | ce Contrat. 525 | 526 | 12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé 527 | et ne peut être modifié que par les auteurs de la licence, lesquels se 528 | réservent le droit de publier périodiquement des mises à jour ou de 529 | nouvelles versions du Contrat, qui posséderont chacune un numéro 530 | distinct. Ces versions ultérieures seront susceptibles de prendre en 531 | compte de nouvelles problématiques rencontrées par les logiciels libres. 532 | 533 | 12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra 534 | faire l'objet d'une diffusion ultérieure que sous la même version du 535 | Contrat ou une version postérieure, sous réserve des dispositions de 536 | l'article 5.3.4 <#compatibilite>. 537 | 538 | 539 | Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE 540 | 541 | 13.1 Le Contrat est régi par la loi française. Les Parties conviennent 542 | de tenter de régler à l'amiable les différends ou litiges qui 543 | viendraient à se produire par suite ou à l'occasion du Contrat. 544 | 545 | 13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter 546 | de leur survenance et sauf situation relevant d'une procédure d'urgence, 547 | les différends ou litiges seront portés par la Partie la plus diligente 548 | devant les Tribunaux compétents de Paris. 549 | 550 | 551 | -------------------------------------------------------------------------------- /LICENSE.GPL3: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------