├── data ├── bin ├── dev │ ├── null │ └── urandom ├── system │ ├── etc │ │ ├── resolv.conf │ │ └── hosts │ ├── fonts │ │ └── source-code-pro │ │ │ ├── SourceCodePro-It.ttf │ │ │ ├── SourceCodePro-Black.ttf │ │ │ ├── SourceCodePro-Bold.ttf │ │ │ ├── SourceCodePro-Light.ttf │ │ │ ├── SourceCodePro-BlackIt.ttf │ │ │ ├── SourceCodePro-BoldIt.ttf │ │ │ ├── SourceCodePro-LightIt.ttf │ │ │ ├── SourceCodePro-Medium.ttf │ │ │ ├── SourceCodePro-Regular.ttf │ │ │ ├── SourceCodePro-ExtraLight.ttf │ │ │ ├── SourceCodePro-MediumIt.ttf │ │ │ ├── SourceCodePro-Semibold.ttf │ │ │ ├── SourceCodePro-SemiboldIt.ttf │ │ │ └── SourceCodePro-ExtraLightIt.ttf │ └── bin │ │ └── ldd └── users │ └── admin │ └── dummy.txt ├── utilities ├── __init__.py ├── kconfig ├── boot ├── image_tool │ ├── README.mbr │ ├── mbr.bin │ └── SConscript ├── todo.sh └── sysgen │ ├── amd64_target.h │ └── arm64_target.h ├── source ├── boot ├── lib │ ├── m │ │ ├── musl │ │ ├── include │ │ │ ├── fenv.h │ │ │ ├── math.h │ │ │ └── complex.h │ │ └── arch │ │ │ └── x86_64 │ │ │ └── bits │ │ │ └── fenv.h │ ├── system │ │ ├── musl │ │ ├── stdlib │ │ │ └── dlmalloc.c │ │ ├── include │ │ │ ├── ctype.h │ │ │ ├── netdb.h │ │ │ ├── uchar.h │ │ │ ├── wchar.h │ │ │ ├── endian.h │ │ │ ├── resolv.h │ │ │ ├── wctype.h │ │ │ ├── features.h │ │ │ ├── arpa │ │ │ │ └── nameser.h │ │ │ ├── memory.h │ │ │ ├── poll.h │ │ │ ├── sys │ │ │ │ ├── param.h │ │ │ │ ├── un.h │ │ │ │ ├── random.h │ │ │ │ └── ioctl.h │ │ │ ├── alloca.h │ │ │ ├── langinfo.h │ │ │ ├── netinet │ │ │ │ └── tcp.h │ │ │ ├── sched.h │ │ │ ├── libgen.h │ │ │ ├── core │ │ │ │ └── path.h │ │ │ └── ucontext.h │ │ ├── arch │ │ │ ├── amd64 │ │ │ │ ├── SConscript │ │ │ │ └── include │ │ │ │ │ └── system │ │ │ │ │ └── arch │ │ │ │ │ ├── defs.h │ │ │ │ │ └── unistd.h │ │ │ └── arm64 │ │ │ │ ├── SConscript │ │ │ │ └── include │ │ │ │ └── system │ │ │ │ └── arch │ │ │ │ ├── setjmp.h │ │ │ │ ├── defs.h │ │ │ │ └── unistd.h │ │ ├── sched.c │ │ ├── string │ │ │ └── ffs.c │ │ ├── stdio │ │ │ ├── tmpfile.c │ │ │ ├── fflush.c │ │ │ ├── remove.c │ │ │ └── fclose.c │ │ └── dirent │ │ │ └── rewinddir.c │ ├── cxx │ │ ├── src │ │ └── include │ ├── crt │ │ ├── lib │ │ └── arch │ │ │ ├── arm64 │ │ │ ├── crti.S │ │ │ ├── crtn.S │ │ │ ├── SConscript │ │ │ └── crt1.S │ │ │ └── amd64 │ │ │ ├── SConscript │ │ │ ├── crt1.S │ │ │ ├── crti.S │ │ │ └── crtn.S │ ├── cxxrt │ │ ├── src │ │ ├── unwind │ │ │ ├── src │ │ │ └── include │ │ └── include │ │ │ ├── cxxabi.h │ │ │ ├── unwind.h │ │ │ ├── unwind-arm.h │ │ │ └── unwind-itanium.h │ ├── compiler-rt │ │ └── lib │ ├── kernel │ │ ├── include │ │ │ └── kernel │ │ └── arch │ │ │ ├── arm64 │ │ │ └── SConscript │ │ │ └── amd64 │ │ │ └── SConscript │ ├── device │ │ └── SConscript │ └── kiwi │ │ └── SConscript ├── bin │ ├── dungeon │ ├── utilities │ │ ├── net_control │ │ │ └── SConscript │ │ └── SConscript │ ├── SConscript │ ├── terminal │ │ └── SConscript │ ├── test │ │ └── test_hello.c │ └── posix │ │ └── SConscript ├── kernel │ ├── include │ │ ├── status.h │ │ ├── device │ │ │ ├── bus │ │ │ │ └── virtio │ │ │ │ │ ├── virtio_ids.h │ │ │ │ │ ├── virtio_ring.h │ │ │ │ │ ├── virtio_config.h │ │ │ │ │ └── virtio_types.h │ │ │ └── console │ │ │ │ ├── pl011.h │ │ │ │ └── ns16550.h │ │ ├── net │ │ │ └── ipv6.h │ │ ├── kernel │ │ │ ├── image.h │ │ │ ├── device │ │ │ │ └── bus │ │ │ │ │ ├── dt.h │ │ │ │ │ └── virtio.h │ │ │ ├── pipe.h │ │ │ ├── log.h │ │ │ ├── net │ │ │ │ └── unix.h │ │ │ └── exit.h │ │ ├── io │ │ │ └── memory_file.h │ │ ├── sync │ │ │ └── futex.h │ │ ├── lib │ │ │ ├── random.h │ │ │ └── printf.h │ │ ├── syscall.h │ │ └── proc │ │ │ └── sched.h │ ├── console │ │ ├── font.c │ │ ├── logo.ppm │ │ └── SConscript │ ├── device │ │ ├── bus │ │ │ ├── dt │ │ │ │ └── fdt │ │ │ ├── virtio │ │ │ │ ├── virtio_pci.h │ │ │ │ └── SConscript │ │ │ ├── pci │ │ │ │ └── SConscript │ │ │ └── SConscript │ │ ├── net │ │ │ ├── virtio_net │ │ │ │ ├── virtio_net.h │ │ │ │ └── SConscript │ │ │ ├── SConscript │ │ │ └── Kconfig │ │ ├── disk │ │ │ ├── pci_ata │ │ │ │ └── SConscript │ │ │ ├── ata │ │ │ │ └── SConscript │ │ │ ├── SConscript │ │ │ └── Kconfig │ │ ├── input │ │ │ ├── i8042 │ │ │ │ └── SConscript │ │ │ ├── Kconfig │ │ │ └── SConscript │ │ ├── timer │ │ │ ├── SConscript │ │ │ ├── arm_timer │ │ │ │ └── SConscript │ │ │ └── Kconfig │ │ ├── console │ │ │ ├── Kconfig │ │ │ └── SConscript │ │ ├── irq │ │ │ ├── arm_gic_v2 │ │ │ │ └── SConscript │ │ │ ├── bcm2836_l1_irq │ │ │ │ └── SConscript │ │ │ ├── SConscript │ │ │ └── Kconfig │ │ ├── Kconfig │ │ └── SConscript │ ├── lib │ │ ├── mt19937-64.h │ │ └── SConscript │ ├── arch │ │ ├── amd64 │ │ │ ├── Kconfig │ │ │ └── include │ │ │ │ ├── arch │ │ │ │ ├── setjmp.h │ │ │ │ ├── cache.h │ │ │ │ ├── kdb.h │ │ │ │ ├── barrier.h │ │ │ │ └── stack.h │ │ │ │ └── x86 │ │ │ │ ├── smp.h │ │ │ │ └── console.h │ │ ├── arm64 │ │ │ ├── Kconfig │ │ │ └── include │ │ │ │ ├── arm64 │ │ │ │ ├── time.h │ │ │ │ └── kdb.h │ │ │ │ └── arch │ │ │ │ ├── cache.h │ │ │ │ ├── kdb.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── barrier.h │ │ │ │ └── stack.h │ │ └── Kconfig │ ├── io │ │ ├── fs │ │ │ ├── ext2 │ │ │ │ └── SConscript │ │ │ ├── Kconfig │ │ │ └── SConscript │ │ └── SConscript │ ├── security │ │ └── SConscript │ ├── proc │ │ └── SConscript │ ├── sync │ │ └── SConscript │ └── mm │ │ └── SConscript └── services │ ├── test │ ├── SConscript │ └── protocol.h │ ├── service_manager │ └── SConscript │ ├── SConscript │ ├── posix_service │ └── SConscript │ └── terminal_service │ ├── SConscript │ └── terminal_service.h ├── 3rdparty ├── lib │ ├── musl │ │ ├── arch │ │ │ └── generic │ │ │ │ └── fp_arch.h │ │ ├── src │ │ │ ├── math │ │ │ │ ├── x86_64 │ │ │ │ │ ├── __invtrigl.s │ │ │ │ │ ├── ceill.s │ │ │ │ │ ├── expm1l.s │ │ │ │ │ ├── truncl.s │ │ │ │ │ ├── logl.s │ │ │ │ │ ├── atanl.s │ │ │ │ │ ├── log2l.s │ │ │ │ │ ├── log10l.s │ │ │ │ │ ├── atan2l.s │ │ │ │ │ ├── fabsl.c │ │ │ │ │ ├── rintl.c │ │ │ │ │ ├── sqrtl.c │ │ │ │ │ ├── sqrt.c │ │ │ │ │ ├── sqrtf.c │ │ │ │ │ ├── lrint.c │ │ │ │ │ ├── lrintf.c │ │ │ │ │ ├── llrint.c │ │ │ │ │ ├── lrintl.c │ │ │ │ │ ├── llrintf.c │ │ │ │ │ ├── llrintl.c │ │ │ │ │ ├── asinl.s │ │ │ │ │ ├── fmodl.c │ │ │ │ │ ├── remainderl.c │ │ │ │ │ ├── log1pl.s │ │ │ │ │ ├── acosl.s │ │ │ │ │ ├── fabs.c │ │ │ │ │ ├── fabsf.c │ │ │ │ │ ├── fmaf.c │ │ │ │ │ ├── fma.c │ │ │ │ │ └── floorl.s │ │ │ │ ├── nan.c │ │ │ │ ├── lround.c │ │ │ │ ├── nanf.c │ │ │ │ ├── lroundf.c │ │ │ │ ├── nanl.c │ │ │ │ ├── tgammaf.c │ │ │ │ ├── ldexp.c │ │ │ │ ├── llround.c │ │ │ │ ├── llroundf.c │ │ │ │ ├── lroundl.c │ │ │ │ ├── ldexpf.c │ │ │ │ ├── llroundl.c │ │ │ │ ├── finite.c │ │ │ │ ├── ldexpl.c │ │ │ │ ├── __math_invalid.c │ │ │ │ ├── __math_invalidf.c │ │ │ │ ├── finitef.c │ │ │ │ ├── signgam.c │ │ │ │ ├── __math_oflow.c │ │ │ │ ├── __math_oflowf.c │ │ │ │ ├── __math_uflow.c │ │ │ │ ├── __math_uflowf.c │ │ │ │ ├── lgamma.c │ │ │ │ ├── lgammaf.c │ │ │ │ ├── nexttowardl.c │ │ │ │ ├── __math_divzero.c │ │ │ │ ├── aarch64 │ │ │ │ │ ├── fabs.c │ │ │ │ │ ├── fabsf.c │ │ │ │ │ ├── sqrt.c │ │ │ │ │ ├── sqrtf.c │ │ │ │ │ ├── ceil.c │ │ │ │ │ ├── ceilf.c │ │ │ │ │ ├── floor.c │ │ │ │ │ ├── floorf.c │ │ │ │ │ ├── rint.c │ │ │ │ │ ├── rintf.c │ │ │ │ │ ├── round.c │ │ │ │ │ ├── roundf.c │ │ │ │ │ ├── trunc.c │ │ │ │ │ ├── truncf.c │ │ │ │ │ ├── nearbyint.c │ │ │ │ │ ├── nearbyintf.c │ │ │ │ │ ├── lround.c │ │ │ │ │ ├── lroundf.c │ │ │ │ │ ├── fmax.c │ │ │ │ │ ├── fmaxf.c │ │ │ │ │ ├── fmin.c │ │ │ │ │ ├── fminf.c │ │ │ │ │ ├── llround.c │ │ │ │ │ ├── llroundf.c │ │ │ │ │ ├── fma.c │ │ │ │ │ ├── fmaf.c │ │ │ │ │ ├── lrint.c │ │ │ │ │ ├── lrintf.c │ │ │ │ │ ├── llrint.c │ │ │ │ │ └── llrintf.c │ │ │ │ ├── significand.c │ │ │ │ ├── significandf.c │ │ │ │ ├── __math_divzerof.c │ │ │ │ ├── lrintf.c │ │ │ │ ├── __math_xflow.c │ │ │ │ ├── __math_xflowf.c │ │ │ │ ├── llrint.c │ │ │ │ ├── llrintf.c │ │ │ │ ├── remainder.c │ │ │ │ ├── remainderf.c │ │ │ │ ├── fabs.c │ │ │ │ ├── fabsf.c │ │ │ │ ├── logbf.c │ │ │ │ ├── fdim.c │ │ │ │ ├── fdimf.c │ │ │ │ ├── __signbitf.c │ │ │ │ ├── copysign.c │ │ │ │ ├── __math_invalidl.c │ │ │ │ ├── __signbit.c │ │ │ │ ├── scalbln.c │ │ │ │ ├── scalblnf.c │ │ │ │ ├── copysignf.c │ │ │ │ ├── __invtrigl.h │ │ │ │ ├── fmax.c │ │ │ │ ├── fmaxf.c │ │ │ │ ├── fmin.c │ │ │ │ ├── fminf.c │ │ │ │ ├── logb.c │ │ │ │ ├── __fpclassifyf.c │ │ │ │ ├── __fpclassify.c │ │ │ │ ├── logbl.c │ │ │ │ ├── nearbyintf.c │ │ │ │ ├── remainderl.c │ │ │ │ ├── __signbitl.c │ │ │ │ ├── fabsl.c │ │ │ │ ├── truncf.c │ │ │ │ ├── fdiml.c │ │ │ │ ├── trunc.c │ │ │ │ ├── sqrt_data.h │ │ │ │ ├── scalblnl.c │ │ │ │ ├── nearbyint.c │ │ │ │ ├── log2f_data.h │ │ │ │ ├── frexpf.c │ │ │ │ ├── copysignl.c │ │ │ │ ├── frexp.c │ │ │ │ ├── logf_data.h │ │ │ │ ├── fmaxl.c │ │ │ │ ├── fminl.c │ │ │ │ ├── nearbyintl.c │ │ │ │ ├── ceilf.c │ │ │ │ ├── floorf.c │ │ │ │ ├── ilogbf.c │ │ │ │ └── ilogb.c │ │ │ ├── complex │ │ │ │ ├── creal.c │ │ │ │ ├── cimag.c │ │ │ │ ├── crealf.c │ │ │ │ ├── cimagf.c │ │ │ │ ├── creall.c │ │ │ │ ├── cabs.c │ │ │ │ ├── carg.c │ │ │ │ ├── cimagl.c │ │ │ │ ├── cabsf.c │ │ │ │ ├── cargf.c │ │ │ │ ├── conj.c │ │ │ │ ├── conjf.c │ │ │ │ ├── ccoshl.c │ │ │ │ ├── cexpl.c │ │ │ │ ├── csinhl.c │ │ │ │ ├── csqrtl.c │ │ │ │ ├── ctanhl.c │ │ │ │ ├── ccosf.c │ │ │ │ ├── cpowf.c │ │ │ │ ├── conjl.c │ │ │ │ ├── ccos.c │ │ │ │ ├── csinf.c │ │ │ │ ├── ctanf.c │ │ │ │ ├── casinhf.c │ │ │ │ ├── catanhf.c │ │ │ │ ├── cpow.c │ │ │ │ ├── cproj.c │ │ │ │ ├── cprojf.c │ │ │ │ ├── clogf.c │ │ │ │ ├── csin.c │ │ │ │ ├── ctan.c │ │ │ │ ├── casinh.c │ │ │ │ ├── catanh.c │ │ │ │ ├── cacosf.c │ │ │ │ ├── clog.c │ │ │ │ ├── cacoshf.c │ │ │ │ ├── cabsl.c │ │ │ │ ├── cargl.c │ │ │ │ ├── cacosh.c │ │ │ │ ├── ccosl.c │ │ │ │ ├── cacos.c │ │ │ │ ├── cpowl.c │ │ │ │ ├── casinf.c │ │ │ │ ├── csinl.c │ │ │ │ ├── ctanl.c │ │ │ │ ├── casinhl.c │ │ │ │ ├── catanhl.c │ │ │ │ ├── clogl.c │ │ │ │ ├── cprojl.c │ │ │ │ ├── casin.c │ │ │ │ ├── cacosl.c │ │ │ │ ├── cacoshl.c │ │ │ │ └── casinl.c │ │ │ ├── ctype │ │ │ │ ├── isascii.c │ │ │ │ ├── toascii.c │ │ │ │ ├── wcswidth.c │ │ │ │ ├── isalnum.c │ │ │ │ ├── isblank.c │ │ │ │ ├── ispunct.c │ │ │ │ ├── iscntrl.c │ │ │ │ ├── iswlower.c │ │ │ │ ├── iswupper.c │ │ │ │ ├── isdigit.c │ │ │ │ ├── islower.c │ │ │ │ ├── isupper.c │ │ │ │ ├── tolower.c │ │ │ │ ├── toupper.c │ │ │ │ ├── isalpha.c │ │ │ │ ├── isgraph.c │ │ │ │ ├── isprint.c │ │ │ │ ├── iswalnum.c │ │ │ │ ├── isxdigit.c │ │ │ │ ├── iswblank.c │ │ │ │ ├── isspace.c │ │ │ │ ├── iswdigit.c │ │ │ │ ├── iswxdigit.c │ │ │ │ ├── iswgraph.c │ │ │ │ ├── iswcntrl.c │ │ │ │ ├── iswpunct.c │ │ │ │ └── iswalpha.c │ │ │ ├── multibyte │ │ │ │ ├── mblen.c │ │ │ │ ├── mbsinit.c │ │ │ │ ├── wctomb.c │ │ │ │ ├── c32rtomb.c │ │ │ │ ├── mbstowcs.c │ │ │ │ ├── wcstombs.c │ │ │ │ ├── mbrlen.c │ │ │ │ ├── btowc.c │ │ │ │ ├── wctob.c │ │ │ │ └── mbrtoc32.c │ │ │ ├── fenv │ │ │ │ ├── fegetexceptflag.c │ │ │ │ ├── feholdexcept.c │ │ │ │ ├── fesetexceptflag.c │ │ │ │ ├── feupdateenv.c │ │ │ │ ├── __flt_rounds.c │ │ │ │ ├── fesetround.c │ │ │ │ └── fenv.c │ │ │ ├── string │ │ │ │ ├── wcslen.c │ │ │ │ ├── wcpcpy.c │ │ │ │ ├── wcswcs.c │ │ │ │ ├── wcscasecmp_l.c │ │ │ │ ├── wcscmp.c │ │ │ │ ├── wcscasecmp.c │ │ │ │ ├── wcspbrk.c │ │ │ │ ├── wcpncpy.c │ │ │ │ ├── wcsncasecmp_l.c │ │ │ │ ├── wcsnlen.c │ │ │ │ ├── wmemset.c │ │ │ │ ├── wcscat.c │ │ │ │ ├── wmemcmp.c │ │ │ │ ├── wcscpy.c │ │ │ │ ├── wcsspn.c │ │ │ │ ├── wmemchr.c │ │ │ │ ├── wcsncmp.c │ │ │ │ ├── wmemcpy.c │ │ │ │ ├── wcsrchr.c │ │ │ │ ├── wcschr.c │ │ │ │ ├── wcsncpy.c │ │ │ │ ├── wcsncat.c │ │ │ │ ├── wcsdup.c │ │ │ │ ├── wcscspn.c │ │ │ │ ├── wcsncasecmp.c │ │ │ │ ├── wcstok.c │ │ │ │ └── wmemmove.c │ │ │ ├── include │ │ │ │ ├── arpa │ │ │ │ │ └── inet.h │ │ │ │ ├── features.h │ │ │ │ └── resolv.h │ │ │ ├── network │ │ │ │ ├── herror.c │ │ │ │ ├── serv.c │ │ │ │ ├── inet_addr.c │ │ │ │ ├── gethostbyname.c │ │ │ │ ├── inet_ntoa.c │ │ │ │ ├── res_send.c │ │ │ │ ├── gethostbyname_r.c │ │ │ │ ├── getservbyname.c │ │ │ │ ├── getservbyport.c │ │ │ │ ├── h_errno.c │ │ │ │ ├── freeaddrinfo.c │ │ │ │ ├── hstrerror.c │ │ │ │ └── gethostbyname2.c │ │ │ ├── prng │ │ │ │ ├── rand.c │ │ │ │ └── rand_r.c │ │ │ ├── locale │ │ │ │ ├── wcscoll.c │ │ │ │ └── c_locale.c │ │ │ └── internal │ │ │ │ └── complex_impl.h │ │ ├── kiwi-version.txt │ │ └── include │ │ │ └── fenv.h │ ├── libcxx │ │ ├── include │ │ │ ├── __libcpp_version │ │ │ └── __support │ │ │ │ └── solaris │ │ │ │ └── floatingpoint.h │ │ ├── kiwi-version.txt │ │ ├── lib │ │ │ ├── notweak.exp │ │ │ ├── weak.exp │ │ │ ├── libc++unexp.exp │ │ │ └── abi │ │ │ │ └── README.TXT │ │ └── src │ │ │ ├── iostream_init.h │ │ │ ├── chrono_system_time_init.h │ │ │ ├── experimental │ │ │ └── memory_resource_init_helper.h │ │ │ ├── support │ │ │ └── solaris │ │ │ │ └── README │ │ │ ├── ryu │ │ │ └── README.txt │ │ │ ├── format.cpp │ │ │ ├── utility.cpp │ │ │ └── variant.cpp │ ├── compiler-rt │ │ ├── kiwi-version.txt │ │ └── lib │ │ │ └── builtins │ │ │ ├── Darwin-excludes │ │ │ ├── ios.txt │ │ │ ├── iossim.txt │ │ │ ├── osx.txt │ │ │ ├── iossim-x86_64.txt │ │ │ ├── CMakeLists.txt │ │ │ ├── ios7-arm64.txt │ │ │ └── osx-i386.txt │ │ │ ├── macho_embedded │ │ │ ├── i386.txt │ │ │ ├── CMakeLists.txt │ │ │ ├── thumb2-64.txt │ │ │ ├── arm.txt │ │ │ └── thumb2.txt │ │ │ ├── x86_64 │ │ │ ├── floatdisf.c │ │ │ ├── floatdixf.c │ │ │ └── floatdidf.c │ │ │ └── riscv │ │ │ ├── muldi3.S │ │ │ └── mulsi3.S │ ├── libunwind │ │ ├── .clang-format │ │ ├── kiwi-version.txt │ │ ├── .arcconfig │ │ └── docs │ │ │ ├── CMakeLists.txt │ │ │ └── README.txt │ └── libcxxrt │ │ ├── AUTHORS │ │ ├── COPYRIGHT │ │ ├── kiwi-version.txt │ │ ├── test │ │ ├── run_test.sh │ │ └── test.h │ │ └── src │ │ └── abi_namespace.h ├── kernel │ └── libfdt │ │ └── kiwi-version.txt ├── bin │ └── dungeon │ │ └── README.Kiwi └── kconfig │ └── lxdialog │ └── BIG.FAT.WARNING ├── documentation └── screenshots │ ├── 1.png │ ├── 2.png │ ├── 3.jpg │ ├── 4.png │ ├── 5.png │ ├── 6.png │ └── 3_small.jpg ├── .gitignore ├── .gitmodules └── .vscode ├── templates ├── Kiwi C Source.c ├── Kiwi C++ Source.cpp └── Kiwi Header.h ├── launch.json ├── settings.json └── tasks.json /data/bin: -------------------------------------------------------------------------------- 1 | system/bin -------------------------------------------------------------------------------- /utilities/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/dev/null: -------------------------------------------------------------------------------- 1 | //@/virtual/null -------------------------------------------------------------------------------- /source/boot: -------------------------------------------------------------------------------- 1 | ../3rdparty/kboot/source -------------------------------------------------------------------------------- /utilities/kconfig: -------------------------------------------------------------------------------- 1 | ../3rdparty/kconfig -------------------------------------------------------------------------------- /3rdparty/lib/musl/arch/generic/fp_arch.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/dev/urandom: -------------------------------------------------------------------------------- 1 | //@/virtual/pseudo_random -------------------------------------------------------------------------------- /source/lib/m/musl: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/musl -------------------------------------------------------------------------------- /utilities/boot: -------------------------------------------------------------------------------- 1 | ../3rdparty/kboot/utilities -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/__invtrigl.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/bin/dungeon: -------------------------------------------------------------------------------- 1 | ../../3rdparty/bin/dungeon -------------------------------------------------------------------------------- /source/kernel/include/status.h: -------------------------------------------------------------------------------- 1 | kernel/status.h -------------------------------------------------------------------------------- /source/lib/system/musl: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/musl -------------------------------------------------------------------------------- /data/system/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 8.8.8.8 2 | -------------------------------------------------------------------------------- /source/lib/cxx/src: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxx/src -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/include/__libcpp_version: -------------------------------------------------------------------------------- 1 | 14000 2 | -------------------------------------------------------------------------------- /source/lib/crt/lib: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/compiler-rt/lib -------------------------------------------------------------------------------- /source/lib/cxx/include: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxx/include -------------------------------------------------------------------------------- /source/lib/cxxrt/src: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/libcxxrt/src -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/ceill.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/expm1l.s: -------------------------------------------------------------------------------- 1 | # see exp2l.s 2 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/truncl.s: -------------------------------------------------------------------------------- 1 | # see floorl.s 2 | -------------------------------------------------------------------------------- /source/kernel/console/font.c: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/kernel/font.c -------------------------------------------------------------------------------- /source/lib/compiler-rt/lib: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/compiler-rt/lib -------------------------------------------------------------------------------- /source/lib/kernel/include/kernel: -------------------------------------------------------------------------------- 1 | ../../../kernel/include/kernel -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Unmodified 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | 3 | -------------------------------------------------------------------------------- /source/kernel/device/bus/dt/fdt: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/libfdt -------------------------------------------------------------------------------- /source/kernel/lib/mt19937-64.h: -------------------------------------------------------------------------------- 1 | ../../../3rdparty/lib/mt19937-64.h -------------------------------------------------------------------------------- /source/lib/cxxrt/unwind/src: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libunwind/src -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Modified (see commit) 3 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/AUTHORS: -------------------------------------------------------------------------------- 1 | David Chisnall 2 | PathScale engineers 3 | -------------------------------------------------------------------------------- /source/lib/cxxrt/unwind/include: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libunwind/include -------------------------------------------------------------------------------- /source/lib/m/include/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/fenv.h -------------------------------------------------------------------------------- /source/lib/m/include/math.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/math.h -------------------------------------------------------------------------------- /source/lib/system/stdlib/dlmalloc.c: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/dlmalloc.c -------------------------------------------------------------------------------- /source/lib/m/include/complex.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/complex.h -------------------------------------------------------------------------------- /source/lib/system/include/ctype.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/ctype.h -------------------------------------------------------------------------------- /source/lib/system/include/netdb.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/netdb.h -------------------------------------------------------------------------------- /source/lib/system/include/uchar.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/uchar.h -------------------------------------------------------------------------------- /source/lib/system/include/wchar.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/wchar.h -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/ios.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | -------------------------------------------------------------------------------- /source/lib/cxxrt/include/cxxabi.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/cxxabi.h -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind.h -------------------------------------------------------------------------------- /source/lib/system/include/endian.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/endian.h -------------------------------------------------------------------------------- /source/lib/system/include/resolv.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/resolv.h -------------------------------------------------------------------------------- /source/lib/system/include/wctype.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/wctype.h -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/iossim.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 14.0.0 2 | Changes: 3 | - src/assembly.h 4 | -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind-arm.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind-arm.h -------------------------------------------------------------------------------- /source/lib/system/include/features.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/musl/include/features.h -------------------------------------------------------------------------------- /data/users/admin/dummy.txt: -------------------------------------------------------------------------------- 1 | Placeholder to get this directory created in the filesystem. 2 | -------------------------------------------------------------------------------- /utilities/image_tool/README.mbr: -------------------------------------------------------------------------------- 1 | mbr.bin from syslinux 6.04. See COPYING.mbr for license. 2 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/COPYRIGHT: -------------------------------------------------------------------------------- 1 | PathScale Inc 2 | NetBSD Foundation 3 | FreeBSD Foundation 4 | -------------------------------------------------------------------------------- /source/kernel/device/bus/virtio/virtio_pci.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/virtio/virtio_pci.h -------------------------------------------------------------------------------- /source/kernel/device/net/virtio_net/virtio_net.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/kernel/virtio/virtio_net.h -------------------------------------------------------------------------------- /source/lib/cxxrt/include/unwind-itanium.h: -------------------------------------------------------------------------------- 1 | ../../../../3rdparty/lib/libcxxrt/src/unwind-itanium.h -------------------------------------------------------------------------------- /source/lib/m/arch/x86_64/bits/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/lib/musl/arch/x86_64/bits/fenv.h -------------------------------------------------------------------------------- /source/lib/system/include/arpa/nameser.h: -------------------------------------------------------------------------------- 1 | ../../../../../3rdparty/lib/musl/include/arpa/nameser.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_ids.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_ids.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_ring.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_ring.h -------------------------------------------------------------------------------- /utilities/image_tool/mbr.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/utilities/image_tool/mbr.bin -------------------------------------------------------------------------------- /documentation/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/1.png -------------------------------------------------------------------------------- /documentation/screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/2.png -------------------------------------------------------------------------------- /documentation/screenshots/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/3.jpg -------------------------------------------------------------------------------- /documentation/screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/4.png -------------------------------------------------------------------------------- /documentation/screenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/5.png -------------------------------------------------------------------------------- /documentation/screenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/6.png -------------------------------------------------------------------------------- /source/kernel/console/logo.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/source/kernel/console/logo.ppm -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_config.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_config.h -------------------------------------------------------------------------------- /source/kernel/include/device/bus/virtio/virtio_types.h: -------------------------------------------------------------------------------- 1 | ../../../../../../3rdparty/kernel/virtio/virtio_types.h -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nan.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nan(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nanf(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /documentation/screenshots/3_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/documentation/screenshots/3_small.jpg -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/notweak.exp: -------------------------------------------------------------------------------- 1 | # Remove the weak-def bit from these external symbols 2 | __ZT* 3 | __ZN* 4 | __ZS* 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nanl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nanl(const char *s) 4 | { 5 | return NAN; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/tgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float tgammaf(float x) 4 | { 5 | return tgamma(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/.arcconfig: -------------------------------------------------------------------------------- 1 | { 2 | "repository.callsign" : "UNW", 3 | "conduit_uri" : "https://reviews.llvm.org/" 4 | } 5 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | 1.2.3 2 | Kiwi modifications indicated by __Kiwi__ defines (with original code in the else) 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ldexp(double x, int n) 4 | { 5 | return scalbn(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | return round(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | return roundf(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/kernel/libfdt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | git://git.kernel.org/pub/scm/utils/dtc/dtc.git 2 | 9d2279e7e6ee937d7c47250720c92dd58fa1aa68 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/creal.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double (creal)(double complex z) 4 | { 5 | return creal(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ldexpf(float x, int n) 4 | { 5 | return scalbnf(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llroundl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundl(long double x) 4 | { 5 | return roundl(x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/kiwi-version.txt: -------------------------------------------------------------------------------- 1 | https://github.com/libcxxrt/libcxxrt.git 2 | 45ca8b1942090226ba9368caeeeabc0d4ee41ad6 3 | Unmodified 4 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimag.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double (cimag)(double complex z) 4 | { 5 | return cimag(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/crealf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float (crealf)(float complex z) 4 | { 5 | return crealf(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isascii 3 | 4 | int isascii(int c) 5 | { 6 | return !(c&~0x7f); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/logl.s: -------------------------------------------------------------------------------- 1 | .global logl 2 | .type logl,@function 3 | logl: 4 | fldln2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimagf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float (cimagf)(float complex z) 4 | { 5 | return cimagf(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/finite.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finite(double x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ldexpl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double ldexpl(long double x, int n) 4 | { 5 | return scalbnl(x, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/atanl.s: -------------------------------------------------------------------------------- 1 | .global atanl 2 | .type atanl,@function 3 | atanl: 4 | fldt 8(%rsp) 5 | fld1 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log2l.s: -------------------------------------------------------------------------------- 1 | .global log2l 2 | .type log2l,@function 3 | log2l: 4 | fld1 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mblen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mblen(const char *s, size_t n) 4 | { 5 | return mbtowc(0, s, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/iostream_init.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | _LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/creall.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double (creall)(long double complex z) 4 | { 5 | return creall(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalid.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_invalid(double x) 4 | { 5 | return (x - x) / (x - x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalidf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_invalidf(float x) 4 | { 5 | return (x - x) / (x - x); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/finitef.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | int finitef(float x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/signgam.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int __signgam = 0; 5 | 6 | weak_alias(__signgam, signgam); 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log10l.s: -------------------------------------------------------------------------------- 1 | .global log10l 2 | .type log10l,@function 3 | log10l: 4 | fldlg2 5 | fldt 8(%rsp) 6 | fyl2x 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/chrono_system_time_init.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | GetSystemTimeInit GetSystemTimeAsFileTimeFunc _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabs.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double cabs(double complex z) 4 | { 5 | return hypot(creal(z), cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/carg.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double carg(double complex z) 4 | { 5 | return atan2(cimag(z), creal(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cimagl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | long double (cimagl)(long double complex z) 4 | { 5 | return cimagl(z); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/atan2l.s: -------------------------------------------------------------------------------- 1 | .global atan2l 2 | .type atan2l,@function 3 | atan2l: 4 | fldt 8(%rsp) 5 | fldt 24(%rsp) 6 | fpatan 7 | ret 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbsinit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int mbsinit(const mbstate_t *st) 4 | { 5 | return !st || !*(unsigned *)st; 6 | } 7 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-It.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-It.ttf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | .DS_Store 4 | /.config* 5 | /build 6 | /images 7 | /.sconsign.dblite 8 | /documentation/markdown/output 9 | /.gdb_history 10 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/osx.txt: -------------------------------------------------------------------------------- 1 | apple_versioning 2 | addtf3 3 | divtf3 4 | multf3 5 | powitf2 6 | subtf3 7 | trampoline_setup 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabsf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float cabsf(float complex z) 4 | { 5 | return hypotf(crealf(z), cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cargf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float cargf(float complex z) 4 | { 5 | return atan2f(cimagf(z), crealf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_oflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_oflow(uint32_t sign) 4 | { 5 | return __math_xflow(sign, 0x1p769); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_oflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_oflowf(uint32_t sign) 4 | { 5 | return __math_xflowf(sign, 0x1p97f); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_uflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_uflow(uint32_t sign) 4 | { 5 | return __math_xflow(sign, 0x1p-767); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_uflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_uflowf(uint32_t sign) 4 | { 5 | return __math_xflowf(sign, 0x1p-95f); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lgamma.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | double lgamma(double x) 5 | { 6 | return __lgamma_r(x, &__signgam); 7 | } 8 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Black.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Light.ttf -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/test/run_test.sh: -------------------------------------------------------------------------------- 1 | test_command=$1 2 | expected_output=$2 3 | test_log=$3 4 | $test_command > $test_log 2>&1 5 | diff $test_log $expected_output 6 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conj.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double complex conj(double complex z) 4 | { 5 | return CMPLX(creal(z), -cimag(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conjf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex conjf(float complex z) 4 | { 5 | return CMPLXF(crealf(z), -cimagf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lgammaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | float lgammaf(float x) 5 | { 6 | return __lgammaf_r(x, &__signgam); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nexttowardl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double nexttowardl(long double x, long double y) 4 | { 5 | return nextafterl(x, y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabsl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double fabsl(long double x) 4 | { 5 | __asm__ ("fabs" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/rintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double rintl(long double x) 4 | { 5 | __asm__ ("frndint" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrtl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double sqrtl(long double x) 4 | { 5 | __asm__ ("fsqrt" : "+t"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-BlackIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-BlackIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-BoldIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-BoldIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-LightIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-LightIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Medium.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /utilities/todo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Kiwi TODO" 3 | echo "=========" 4 | echo 5 | find source -type f -print0 | xargs -0r egrep -HIi --color=auto "(TODO|FIXME)" 6 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccoshl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex ccoshl(long double complex z) 5 | { 6 | return ccosh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cexpl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex cexpl(long double complex z) 5 | { 6 | return cexp(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex csinhl(long double complex z) 5 | { 6 | return csinh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csqrtl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex csqrtl(long double complex z) 5 | { 6 | return csqrt(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | //FIXME 4 | long double complex ctanhl(long double complex z) 5 | { 6 | return ctanh(z); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_divzero.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_divzero(uint32_t sign) 4 | { 5 | return fp_barrier(sign ? -1.0 : 1.0) / 0.0; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | __asm__ ("fabs %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | __asm__ ("fabs %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("fsqrt %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("fsqrt %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/significand.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | double significand(double x) 5 | { 6 | return scalbn(x, -ilogb(x)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/significandf.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | float significandf(float x) 5 | { 6 | return scalbnf(x, -ilogbf(x)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrt.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double sqrt(double x) 4 | { 5 | __asm__ ("sqrtsd %1, %0" : "=x"(x) : "x"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/sqrtf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float sqrtf(float x) 4 | { 5 | __asm__ ("sqrtss %1, %0" : "=x"(x) : "x"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-ExtraLight.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-MediumIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-MediumIt.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-Semibold.ttf -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-SemiboldIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-SemiboldIt.ttf -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/experimental/memory_resource_init_helper.h: -------------------------------------------------------------------------------- 1 | #pragma GCC system_header 2 | _LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccosf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex ccosf(float complex z) 4 | { 5 | return ccoshf(CMPLXF(-cimagf(z), crealf(z))); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpowf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cpowf(float complex z, float complex c) 4 | { 5 | return cexpf(c * clogf(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/toascii.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* nonsense function that should NEVER be used! */ 4 | int toascii(int c) 5 | { 6 | return c & 0x7f; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fegetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fegetexceptflag(fexcept_t *fp, int mask) 4 | { 5 | *fp = fetestexcept(mask); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_divzerof.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_divzerof(uint32_t sign) 4 | { 5 | return fp_barrierf(sign ? -1.0f : 1.0f) / 0.0f; 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/ceil.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double ceil(double x) 4 | { 5 | __asm__ ("frintp %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/ceilf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float ceilf(float x) 4 | { 5 | __asm__ ("frintp %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/floor.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double floor(double x) 4 | { 5 | __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/floorf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float floorf(float x) 4 | { 5 | __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/rint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double rint(double x) 4 | { 5 | __asm__ ("frintx %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/rintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float rintf(float x) 4 | { 5 | __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/round.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double round(double x) 4 | { 5 | __asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/roundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float roundf(float x) 4 | { 5 | __asm__ ("frinta %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/trunc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double trunc(double x) 4 | { 5 | __asm__ ("frintz %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/truncf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float truncf(float x) 4 | { 5 | __asm__ ("frintz %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcslen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcslen(const wchar_t *s) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s; s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /data/system/fonts/source-code-pro/SourceCodePro-ExtraLightIt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aejsmith/kiwi/HEAD/data/system/fonts/source-code-pro/SourceCodePro-ExtraLightIt.ttf -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/conjl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | long double complex conjl(long double complex z) 4 | { 5 | return CMPLXL(creall(z), -cimagl(z)); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long lrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcpcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpcpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | return wcscpy(d, s) + wcslen(s); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcswcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcswcs(const wchar_t *haystack, const wchar_t *needle) 4 | { 5 | return wcsstr(haystack, needle); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/feholdexcept.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feholdexcept(fenv_t *envp) 4 | { 5 | fegetenv(envp); 6 | feclearexcept(FE_ALL_EXCEPT); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_xflow.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double __math_xflow(uint32_t sign, double y) 4 | { 5 | return eval_as_double(fp_barrier(sign ? -y : y) * y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_xflowf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float __math_xflowf(uint32_t sign, float y) 4 | { 5 | return eval_as_float(fp_barrierf(sign ? -y : y) * y); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/nearbyint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double nearbyint(double x) 4 | { 5 | __asm__ ("frinti %d0, %d1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/nearbyintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float nearbyintf(float x) 4 | { 5 | __asm__ ("frinti %s0, %s1" : "=w"(x) : "w"(x)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^53, see comments in lrint.c */ 4 | 5 | long long llrint(double x) 6 | { 7 | return rint(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrint(double x) 4 | { 5 | long r; 6 | __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | long r; 6 | __asm__ ("cvtss2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscasecmp_l(const wchar_t *l, const wchar_t *r, locale_t locale) 4 | { 5 | return wcscasecmp(l, r); 6 | } 7 | -------------------------------------------------------------------------------- /data/system/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 2 | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 3 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lround(double x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lroundf(float x) 4 | { 5 | long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* uses LLONG_MAX > 2^24, see comments in lrint.c */ 4 | 5 | long long llrintf(float x) 6 | { 7 | return rintf(x); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcscmp(const wchar_t *l, const wchar_t *r) 4 | { 5 | for (; *l==*r && *l && *r; l++, r++); 6 | return *l - *r; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmax(double x, double y) 4 | { 5 | __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmaxf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaxf(float x, float y) 4 | { 5 | __asm__ ("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmin(double x, double y) 4 | { 5 | __asm__ ("fminnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fminf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fminf(float x, float y) 4 | { 5 | __asm__ ("fminnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrint(double x) 4 | { 5 | long long r; 6 | __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/lrintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintl(long double x) 4 | { 5 | long r; 6 | __asm__ ("fistpll %0" : "=m"(r) : "t"(x) : "st"); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wctomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wctomb(char *s, wchar_t wc) 5 | { 6 | if (!s) return 0; 7 | return wcrtomb(s, wc, 0); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wcscasecmp(const wchar_t *l, const wchar_t *r) 5 | { 6 | return wcsncasecmp(l, r, -1); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcspbrk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcspbrk(const wchar_t *s, const wchar_t *b) 4 | { 5 | s += wcscspn(s, b); 6 | return *s ? (wchar_t *)s : NULL; 7 | } 8 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config KERNEL_ARCH_AMD64 7 | def_bool y 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llround.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llround(double x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llroundf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llroundf(float x) 4 | { 5 | long long n; 6 | __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x)); 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | long long r; 6 | __asm__ ("cvtss2si %1, %0" : "=r"(r) : "x"(x)); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcpncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcpncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | return wcsncpy(d, s, n) + wcsnlen(s, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncasecmp_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncasecmp_l(const wchar_t *l, const wchar_t *r, size_t n, locale_t locale) 4 | { 5 | return wcsncasecmp(l, r, n); 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsnlen(const wchar_t *s, size_t n) 4 | { 5 | const wchar_t *z = wmemchr(s, 0, n); 6 | if (z) n = z-s; 7 | return n; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemset.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemset(wchar_t *d, wchar_t c, size_t n) 4 | { 5 | wchar_t *ret = d; 6 | while (n--) *d++ = c; 7 | return ret; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccos.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* cos(z) = cosh(i z) */ 4 | 5 | double complex ccos(double complex z) 6 | { 7 | return ccosh(CMPLX(-cimag(z), creal(z))); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainder.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double remainder(double x, double y) 4 | { 5 | int q; 6 | return remquo(x, y, &q); 7 | } 8 | 9 | weak_alias(remainder, drem); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/llrintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintl(long double x) 4 | { 5 | long long r; 6 | __asm__ ("fistpll %0" : "=m"(r) : "t"(x) : "st"); 7 | return r; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscat(wchar_t *restrict dest, const wchar_t *restrict src) 4 | { 5 | wcscpy(dest + wcslen(dest), src); 6 | return dest; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r; n--, l++, r++); 6 | return n ? *l-*r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainderf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float remainderf(float x, float y) 4 | { 5 | int q; 6 | return remquof(x, y, &q); 7 | } 8 | 9 | weak_alias(remainderf, dremf); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcscpy(wchar_t *restrict d, const wchar_t *restrict s) 4 | { 5 | wchar_t *a = d; 6 | while ((*d++ = *s++)); 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcsspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | for (a=s; *s && wcschr(c, *s); s++); 7 | return s-a; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) 4 | { 5 | for (; n && *s != c; n--, s++); 6 | return n ? (wchar_t *)s : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex csinf(float complex z) 4 | { 5 | z = csinhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex ctanf(float complex z) 4 | { 5 | z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fesetexceptflag.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fesetexceptflag(const fexcept_t *fp, int mask) 4 | { 5 | feclearexcept(~*fp & mask); 6 | feraiseexcept(*fp & mask); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fma(double x, double y, double z) 4 | { 5 | __asm__ ("fmadd %d0, %d1, %d2, %d3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaf(float x, float y, float z) 4 | { 5 | __asm__ ("fmadd %s0, %s1, %s2, %s3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); 6 | return x; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double fabs(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | u.i &= -1ULL/2; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float fabsf(float x) 5 | { 6 | union {float f; uint32_t i;} u = {x}; 7 | u.i &= 0x7fffffff; 8 | return u.f; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logbf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float logbf(float x) 4 | { 5 | if (!isfinite(x)) 6 | return x * x; 7 | if (x == 0) 8 | return -1/(x*x); 9 | return ilogbf(x); 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/c32rtomb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t c32rtomb(char *restrict s, char32_t c32, mbstate_t *restrict ps) 5 | { 6 | return wcrtomb(s, c32, ps); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinhf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex casinhf(float complex z) 4 | { 5 | z = casinf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanhf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex catanhf(float complex z) 4 | { 5 | z = catanf(CMPLXF(-cimagf(z), crealf(z))); 6 | return CMPLXF(cimagf(z), -crealf(z)); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #ifndef ARPA_INET_H 2 | #define ARPA_INET_H 3 | 4 | #include "../../../include/arpa/inet.h" 5 | 6 | hidden int __inet_aton(const char *, struct in_addr *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fdim(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdimf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fdimf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return x; 7 | if (isnan(y)) 8 | return y; 9 | return x > y ? x - y : 0; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n) 4 | { 5 | for (; n && *l==*r && *l && *r; n--, l++, r++); 6 | return n ? *l - *r : 0; 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemcpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wmemcpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n--) *d++ = *s++; 7 | return a; 8 | } 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rdparty/kboot"] 2 | path = 3rdparty/kboot 3 | url = https://github.com/aejsmith/kboot.git 4 | [submodule "packages"] 5 | path = packages 6 | url = https://github.com/aejsmith/kiwi-packages.git 7 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbstowcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t mbstowcs(wchar_t *restrict ws, const char *restrict s, size_t wn) 5 | { 6 | return mbsrtowcs(ws, (void*)&s, wn, 0); 7 | } 8 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config KERNEL_ARCH_ARM64 7 | def_bool y 8 | select DEVICE_BUS_DT 9 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi C Source.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /3rdparty/bin/dungeon/README.Kiwi: -------------------------------------------------------------------------------- 1 | This is based on the MINIX 3 port of Dungeon, obtained from 2 | 3 | http://www.minix3.org/software/dungeon-2.7.1.tar.bz2 4 | 5 | With small modifications by Alex Smith 6 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpow.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* pow(z, c) = exp(c log(z)), See C99 G.6.4.1 */ 4 | 5 | double complex cpow(double complex z, double complex c) 6 | { 7 | return cexp(c * clog(z)); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/feupdateenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int feupdateenv(const fenv_t *envp) 4 | { 5 | int ex = fetestexcept(FE_ALL_EXCEPT); 6 | fesetenv(envp); 7 | feraiseexcept(ex); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbitf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbitf(float x) 5 | { 6 | union { 7 | float f; 8 | uint32_t i; 9 | } y = { x }; 10 | return y.i>>31; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrint(double x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysign.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double copysign(double x, double y) { 4 | union {double f; uint64_t i;} ux={x}, uy={y}; 5 | ux.i &= -1ULL/2; 6 | ux.i |= uy.i & 1ULL<<63; 7 | return ux.f; 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi C++ Source.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/iossim-x86_64.txt: -------------------------------------------------------------------------------- 1 | addtf3 2 | divtf3 3 | multf3 4 | powitf2 5 | subtf3 6 | trampoline_setup 7 | addtf3 8 | divtf3 9 | multf3 10 | powitf2 11 | subtf3 12 | trampoline_setup 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/lrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long lrintf(float x) 4 | { 5 | long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wcstombs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t wcstombs(char *restrict s, const wchar_t *restrict ws, size_t n) 5 | { 6 | return wcsrtombs(s, &(const wchar_t *){ws}, n, 0); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/herror.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | 5 | void herror(const char *msg) 6 | { 7 | fprintf(stderr, "%s%s%s\n", msg?msg:"", msg?": ":"", hstrerror(h_errno)); 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/serv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void endservent(void) 4 | { 5 | } 6 | 7 | void setservent(int stayopen) 8 | { 9 | } 10 | 11 | struct servent *getservent(void) 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsrchr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsrchr(const wchar_t *s, wchar_t c) 4 | { 5 | const wchar_t *p; 6 | for (p=s+wcslen(s); p>=s && *p!=c; p--); 7 | return p>=s ? (wchar_t *)p : 0; 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/templates/Kiwi Header.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Author 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief . 9 | */ 10 | 11 | #pragma once 12 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/i386.txt: -------------------------------------------------------------------------------- 1 | i686.get_pc_thunk.eax 2 | i686.get_pc_thunk.ebp 3 | i686.get_pc_thunk.ebx 4 | i686.get_pc_thunk.ecx 5 | i686.get_pc_thunk.edi 6 | i686.get_pc_thunk.edx 7 | i686.get_pc_thunk.esi 8 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(FindSphinx) 2 | if (SPHINX_FOUND AND LLVM_ENABLE_SPHINX) 3 | include(AddSphinxTarget) 4 | if (${SPHINX_OUTPUT_HTML}) 5 | add_sphinx_target(html libunwind) 6 | endif() 7 | endif() 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cproj.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | double complex cproj(double complex z) 4 | { 5 | if (isinf(creal(z)) || isinf(cimag(z))) 6 | return CMPLX(INFINITY, copysign(0.0, cimag(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/wcswidth.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int wcswidth(const wchar_t *wcs, size_t n) 4 | { 5 | int l=0, k=0; 6 | for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++); 7 | return (k < 0) ? k : l; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__math_invalidl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | #if LDBL_MANT_DIG != DBL_MANT_DIG 5 | long double __math_invalidl(long double x) 6 | { 7 | return (x - x) / (x - x); 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/asinl.s: -------------------------------------------------------------------------------- 1 | .global asinl 2 | .type asinl,@function 3 | asinl: 4 | fldt 8(%rsp) 5 | 1: fld %st(0) 6 | fld1 7 | fsub %st(0),%st(1) 8 | fadd %st(2) 9 | fmulp 10 | fsqrt 11 | fpatan 12 | ret 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcschr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcschr(const wchar_t *s, wchar_t c) 4 | { 5 | if (!c) return (wchar_t *)s + wcslen(s); 6 | for (; *s && *s != c; s++); 7 | return *s ? (wchar_t *)s : 0; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cprojf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cprojf(float complex z) 4 | { 5 | if (isinf(crealf(z)) || isinf(cimagf(z))) 6 | return CMPLXF(INFINITY, copysignf(0.0, cimagf(z))); 7 | return z; 8 | } 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbit.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | // FIXME: macro in math.h 4 | int __signbit(double x) 5 | { 6 | union { 7 | double d; 8 | uint64_t i; 9 | } y = { x }; 10 | return y.i>>63; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llrint.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrint(double x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %d1, %d1\n" 8 | "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/aarch64/llrintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long long llrintf(float x) 4 | { 5 | long long n; 6 | __asm__ ( 7 | "frintx %s1, %s1\n" 8 | "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x)); 9 | return n; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/src/abi_namespace.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The namespace used for the ABI declarations. This is currently defined to 3 | * be the same as GNU libsupc++, however this may change in the future. 4 | */ 5 | #define ABI_NAMESPACE __cxxabiv1 6 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxxrt/test/test.h: -------------------------------------------------------------------------------- 1 | 2 | void log_test(bool predicate, const char *file, int line, const char *message); 3 | 4 | #define TEST(p, m) log_test(p, __FILE__, __LINE__, m) 5 | #define TEST_LOC(p, m, file, line) log_test(p, file, line, m) 6 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbrlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) 4 | { 5 | static unsigned internal; 6 | return mbrtowc(0, s, n, st ? st : (mbstate_t *)&internal); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clogf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | float complex clogf(float complex z) 6 | { 7 | float r, phi; 8 | 9 | r = cabsf(z); 10 | phi = cargf(z); 11 | return CMPLXF(logf(r), phi); 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csin.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* sin(z) = -i sinh(i z) */ 4 | 5 | double complex csin(double complex z) 6 | { 7 | z = csinh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctan.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* tan(z) = -i tanh(i z) */ 4 | 5 | double complex ctan(double complex z) 6 | { 7 | z = ctanh(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /source/services/test/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create() 9 | env.KiwiService('test', ['main.c']) 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* asinh(z) = -i asin(i z) */ 4 | 5 | double complex casinh(double complex z) 6 | { 7 | z = casin(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* atanh = -i atan(i z) */ 4 | 5 | double complex catanh(double complex z) 6 | { 7 | z = catan(CMPLX(-cimag(z), creal(z))); 8 | return CMPLX(cimag(z), -creal(z)); 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalbln.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double scalbln(double x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbn(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalblnf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float scalblnf(float x, long n) 5 | { 6 | if (n > INT_MAX) 7 | n = INT_MAX; 8 | else if (n < INT_MIN) 9 | n = INT_MIN; 10 | return scalbnf(x, n); 11 | } 12 | -------------------------------------------------------------------------------- /source/kernel/device/disk/pci_ata/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('pci_ata', [ 9 | 'pci_ata.c', 10 | ]) 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncpy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | while (n && *s) n--, *d++ = *s++; 7 | wmemset(d, 0, n); 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0" 6 | } 7 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt) 2 | foreach(filter_file ${filter_files}) 3 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file}) 4 | endforeach() 5 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB filter_files ${CMAKE_CURRENT_SOURCE_DIR}/*.txt) 2 | foreach(filter_file ${filter_files}) 3 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filter_file}) 4 | endforeach() 5 | -------------------------------------------------------------------------------- /source/kernel/device/net/virtio_net/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('virtio_net', [ 9 | 'virtio_net.c', 10 | ]) 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isalnum(int c) 4 | { 5 | return isalpha(c) || isdigit(c); 6 | } 7 | 8 | int __isalnum_l(int c, locale_t l) 9 | { 10 | return isalnum(c); 11 | } 12 | 13 | weak_alias(__isalnum_l, isalnum_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isblank(int c) 4 | { 5 | return (c == ' ' || c == '\t'); 6 | } 7 | 8 | int __isblank_l(int c, locale_t l) 9 | { 10 | return isblank(c); 11 | } 12 | 13 | weak_alias(__isblank_l, isblank_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/ispunct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ispunct(int c) 4 | { 5 | return isgraph(c) && !isalnum(c); 6 | } 7 | 8 | int __ispunct_l(int c, locale_t l) 9 | { 10 | return ispunct(c); 11 | } 12 | 13 | weak_alias(__ispunct_l, ispunct_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysignf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float copysignf(float x, float y) 5 | { 6 | union {float f; uint32_t i;} ux={x}, uy={y}; 7 | ux.i &= 0x7fffffff; 8 | ux.i |= uy.i & 0x80000000; 9 | return ux.f; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/inet_addr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | in_addr_t inet_addr(const char *p) 6 | { 7 | struct in_addr a; 8 | if (!__inet_aton(p, &a)) return -1; 9 | return a.s_addr; 10 | } 11 | -------------------------------------------------------------------------------- /source/kernel/arch/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | if ARCH_AMD64 7 | source "amd64/Kconfig" 8 | endif 9 | 10 | if ARCH_ARM64 11 | source "arm64/Kconfig" 12 | endif 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | static const float float_pi_2 = M_PI_2; 6 | 7 | float complex cacosf(float complex z) 8 | { 9 | z = casinf(z); 10 | return CMPLXF(float_pi_2 - crealf(z), -cimagf(z)); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fmodl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double fmodl(long double x, long double y) 4 | { 5 | unsigned short fpsr; 6 | do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); 7 | while (fpsr & 0x400); 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcsncat(wchar_t *restrict d, const wchar_t *restrict s, size_t n) 4 | { 5 | wchar_t *a = d; 6 | d += wcslen(d); 7 | while (n && *s) n--, *d++ = *s++; 8 | *d++ = 0; 9 | return a; 10 | } 11 | -------------------------------------------------------------------------------- /source/kernel/device/input/i8042/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('i8042', [ 9 | 'i8042.c', 10 | 'keycodes.c', 11 | ]) 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iscntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iscntrl(int c) 4 | { 5 | return (unsigned)c < 0x20 || c == 0x7f; 6 | } 7 | 8 | int __iscntrl_l(int c, locale_t l) 9 | { 10 | return iscntrl(c); 11 | } 12 | 13 | weak_alias(__iscntrl_l, iscntrl_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswlower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswlower(wint_t wc) 4 | { 5 | return towupper(wc) != wc; 6 | } 7 | 8 | int __iswlower_l(wint_t c, locale_t l) 9 | { 10 | return iswlower(c); 11 | } 12 | 13 | weak_alias(__iswlower_l, iswlower_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswupper(wint_t wc) 4 | { 5 | return towlower(wc) != wc; 6 | } 7 | 8 | int __iswupper_l(wint_t c, locale_t l) 9 | { 10 | return iswupper(c); 11 | } 12 | 13 | weak_alias(__iswupper_l, iswupper_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__invtrigl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* shared by acosl, asinl and atan2l */ 4 | #define pio2_hi __pio2_hi 5 | #define pio2_lo __pio2_lo 6 | hidden extern const long double pio2_hi, pio2_lo; 7 | 8 | hidden long double __invtrigl_R(long double z); 9 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsdup.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wcsdup(const wchar_t *s) 5 | { 6 | size_t l = wcslen(s); 7 | wchar_t *d = malloc((l+1)*sizeof(wchar_t)); 8 | if (!d) return NULL; 9 | return wmemcpy(d, s, l+1); 10 | } 11 | -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env') 7 | 8 | sources = [File(f) for f in [ 9 | 'setjmp.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env') 7 | 8 | sources = [File(f) for f in [ 9 | 'setjmp.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /3rdparty/kconfig/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isdigit 3 | 4 | int isdigit(int c) 5 | { 6 | return (unsigned)c-'0' < 10; 7 | } 8 | 9 | int __isdigit_l(int c, locale_t l) 10 | { 11 | return isdigit(c); 12 | } 13 | 14 | weak_alias(__isdigit_l, isdigit_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/islower.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef islower 3 | 4 | int islower(int c) 5 | { 6 | return (unsigned)c-'a' < 26; 7 | } 8 | 9 | int __islower_l(int c, locale_t l) 10 | { 11 | return islower(c); 12 | } 13 | 14 | weak_alias(__islower_l, islower_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isupper 3 | 4 | int isupper(int c) 5 | { 6 | return (unsigned)c-'A' < 26; 7 | } 8 | 9 | int __isupper_l(int c, locale_t l) 10 | { 11 | return isupper(c); 12 | } 13 | 14 | weak_alias(__isupper_l, isupper_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/tolower.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int tolower(int c) 4 | { 5 | if (isupper(c)) return c | 32; 6 | return c; 7 | } 8 | 9 | int __tolower_l(int c, locale_t l) 10 | { 11 | return tolower(c); 12 | } 13 | 14 | weak_alias(__tolower_l, tolower_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/toupper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int toupper(int c) 4 | { 5 | if (islower(c)) return c & 0x5f; 6 | return c; 7 | } 8 | 9 | int __toupper_l(int c, locale_t l) 10 | { 11 | return toupper(c); 12 | } 13 | 14 | weak_alias(__toupper_l, toupper_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/remainderl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long double remainderl(long double x, long double y) 4 | { 5 | unsigned short fpsr; 6 | do __asm__ ("fprem1; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); 7 | while (fpsr & 0x400); 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/btowc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "internal.h" 5 | 6 | wint_t btowc(int c) 7 | { 8 | int b = (unsigned char)c; 9 | return b<128U ? b : (MB_CUR_MAX==1 && c!=EOF) ? CODEUNIT(c) : WEOF; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/prng/rand.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static uint64_t seed; 5 | 6 | void srand(unsigned s) 7 | { 8 | seed = s-1; 9 | } 10 | 11 | int rand(void) 12 | { 13 | seed = 6364136223846793005ULL*seed + 1; 14 | return seed>>33; 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clog.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | /* log(z) = log(|z|) + i arg(z) */ 6 | 7 | double complex clog(double complex z) 8 | { 9 | double r, phi; 10 | 11 | r = cabs(z); 12 | phi = carg(z); 13 | return CMPLX(log(r), phi); 14 | } 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isalpha 3 | 4 | int isalpha(int c) 5 | { 6 | return ((unsigned)c|32)-'a' < 26; 7 | } 8 | 9 | int __isalpha_l(int c, locale_t l) 10 | { 11 | return isalpha(c); 12 | } 13 | 14 | weak_alias(__isalpha_l, isalpha_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isgraph.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isgraph 3 | 4 | int isgraph(int c) 5 | { 6 | return (unsigned)c-0x21 < 0x5e; 7 | } 8 | 9 | int __isgraph_l(int c, locale_t l) 10 | { 11 | return isgraph(c); 12 | } 13 | 14 | weak_alias(__isgraph_l, isgraph_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isprint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isprint 3 | 4 | int isprint(int c) 5 | { 6 | return (unsigned)c-0x20 < 0x5f; 7 | } 8 | 9 | int __isprint_l(int c, locale_t l) 10 | { 11 | return isprint(c); 12 | } 13 | 14 | weak_alias(__isprint_l, isprint_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswalnum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswalnum(wint_t wc) 4 | { 5 | return iswdigit(wc) || iswalpha(wc); 6 | } 7 | 8 | int __iswalnum_l(wint_t c, locale_t l) 9 | { 10 | return iswalnum(c); 11 | } 12 | 13 | weak_alias(__iswalnum_l, iswalnum_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int isxdigit(int c) 4 | { 5 | return isdigit(c) || ((unsigned)c|32)-'a' < 6; 6 | } 7 | 8 | int __isxdigit_l(int c, locale_t l) 9 | { 10 | return isxdigit(c); 11 | } 12 | 13 | weak_alias(__isxdigit_l, isxdigit_l); 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/log1pl.s: -------------------------------------------------------------------------------- 1 | .global log1pl 2 | .type log1pl,@function 3 | log1pl: 4 | mov 14(%rsp),%eax 5 | fldln2 6 | and $0x7fffffff,%eax 7 | fldt 8(%rsp) 8 | cmp $0x3ffd9400,%eax 9 | ja 1f 10 | fyl2xp1 11 | ret 12 | 1: fld1 13 | faddp 14 | fyl2x 15 | ret 16 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/ios7-arm64.txt: -------------------------------------------------------------------------------- 1 | clzti2 2 | divti3 3 | fixdfti 4 | fixsfti 5 | fixunsdfti 6 | floattidf 7 | floattisf 8 | floatuntidf 9 | floatuntisf 10 | gcc_personality_v0 11 | modti3 12 | powidf2 13 | powisf2 14 | udivmodti4 15 | udivti3 16 | umodti3 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswblank.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int iswblank(wint_t wc) 5 | { 6 | return isblank(wc); 7 | } 8 | 9 | int __iswblank_l(wint_t c, locale_t l) 10 | { 11 | return iswblank(c); 12 | } 13 | 14 | weak_alias(__iswblank_l, iswblank_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/acosl.s: -------------------------------------------------------------------------------- 1 | # see ../i386/acos.s 2 | 3 | .global acosl 4 | .type acosl,@function 5 | acosl: 6 | fldt 8(%rsp) 7 | 1: fld %st(0) 8 | fld1 9 | fsub %st(0),%st(1) 10 | fadd %st(2) 11 | fmulp 12 | fsqrt 13 | fabs 14 | fxch %st(1) 15 | fpatan 16 | ret 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/wctob.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "internal.h" 5 | 6 | int wctob(wint_t c) 7 | { 8 | if (c < 128U) return c; 9 | if (MB_CUR_MAX==1 && IS_CODEUNIT(c)) return (unsigned char)c; 10 | return EOF; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/gethostbyname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct hostent *gethostbyname(const char *name) 9 | { 10 | return gethostbyname2(name, AF_INET); 11 | } 12 | -------------------------------------------------------------------------------- /data/system/bin/ldd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # SPDX-FileCopyrightText: (C) Alex Smith 4 | # SPDX-License-Identifier: ISC 5 | # 6 | 7 | if [ $# -ne 1 ]; then 8 | echo "Usage: ldd file" 9 | exit 1 10 | fi 11 | 12 | export LIBKERNEL_DRY_RUN=1 13 | exec "$1" 14 | -------------------------------------------------------------------------------- /source/lib/kernel/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | sources = [File(f) for f in [ 7 | 'relocate.c', 8 | 'rtld.c', 9 | 'start.S', 10 | ]] 11 | 12 | Return('sources') 13 | -------------------------------------------------------------------------------- /source/lib/system/include/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Memory functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/isspace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #undef isspace 3 | 4 | int isspace(int c) 5 | { 6 | return c == ' ' || (unsigned)c-'\t' < 5; 7 | } 8 | 9 | int __isspace_l(int c, locale_t l) 10 | { 11 | return isspace(c); 12 | } 13 | 14 | weak_alias(__isspace_l, isspace_l); 15 | -------------------------------------------------------------------------------- /source/kernel/io/fs/ext2/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('ext2', [ 9 | 'block.c', 10 | 'dir.c', 11 | 'ext2.c', 12 | 'inode.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/support/solaris/README: -------------------------------------------------------------------------------- 1 | This directory contains a partial implementation of the xlocale APIs for 2 | Solaris. Some portions are lifted from FreeBSD libc, and so are covered by a 3 | 2-clause BSD license instead of the MIT/UUIC license that the rest of libc++ is 4 | distributed under. 5 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacoshf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | float complex cacoshf(float complex z) 4 | { 5 | int zineg = signbit(cimagf(z)); 6 | 7 | z = cacosf(z); 8 | if (zineg) return CMPLXF(cimagf(z), -crealf(z)); 9 | else return CMPLXF(-cimagf(z), crealf(z)); 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/inet_ntoa.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *inet_ntoa(struct in_addr in) 5 | { 6 | static char buf[16]; 7 | unsigned char *a = (void *)∈ 8 | snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); 9 | return buf; 10 | } 11 | -------------------------------------------------------------------------------- /source/kernel/device/disk/ata/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('mod_env') 7 | 8 | mod_env.Module('ata', [ 9 | 'ata.c', 10 | 'channel.c', 11 | 'device.c', 12 | 'sff.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /source/lib/system/include/poll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Input/output multiplexing. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #undef iswdigit 4 | 5 | int iswdigit(wint_t wc) 6 | { 7 | return (unsigned)wc-'0' < 10; 8 | } 9 | 10 | int __iswdigit_l(wint_t c, locale_t l) 11 | { 12 | return iswdigit(c); 13 | } 14 | 15 | weak_alias(__iswdigit_l, iswdigit_l); 16 | -------------------------------------------------------------------------------- /source/kernel/security/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'token.c', 11 | ]) 12 | -------------------------------------------------------------------------------- /source/lib/kernel/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | sources = [File(f) for f in [ 7 | 'relocate.c', 8 | 'rtld.c', 9 | 'start.S', 10 | 'tls.c', 11 | ]] 12 | 13 | Return('sources') 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcscspn.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | size_t wcscspn(const wchar_t *s, const wchar_t *c) 4 | { 5 | const wchar_t *a; 6 | if (!c[0]) return wcslen(s); 7 | if (!c[1]) return (s=wcschr(a=s, *c)) ? s-a : wcslen(a); 8 | for (a=s; *s && !wcschr(c, *s); s++); 9 | return s-a; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswxdigit.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswxdigit(wint_t wc) 4 | { 5 | return (unsigned)(wc-'0') < 10 || (unsigned)((wc|32)-'a') < 6; 6 | } 7 | 8 | int __iswxdigit_l(wint_t c, locale_t l) 9 | { 10 | return iswxdigit(c); 11 | } 12 | 13 | weak_alias(__iswxdigit_l, iswxdigit_l); 14 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crti.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 C runtime. 9 | */ 10 | 11 | /* Not needed. */ 12 | 13 | .section ".note.GNU-stack", "", @progbits 14 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crtn.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 C runtime. 9 | */ 10 | 11 | /* Not needed. */ 12 | 13 | .section ".note.GNU-stack", "", @progbits 14 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/thumb2-64.txt: -------------------------------------------------------------------------------- 1 | sync_fetch_and_add_8 2 | sync_fetch_and_sub_8 3 | sync_fetch_and_and_8 4 | sync_fetch_and_or_8 5 | sync_fetch_and_xor_8 6 | sync_fetch_and_nand_8 7 | sync_fetch_and_max_8 8 | sync_fetch_and_umax_8 9 | sync_fetch_and_min_8 10 | sync_fetch_and_umin_8 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fabs(double x) 4 | { 5 | double t; 6 | __asm__ ("pcmpeqd %0, %0" : "=x"(t)); // t = ~0 7 | __asm__ ("psrlq $1, %0" : "+x"(t)); // t >>= 1 8 | __asm__ ("andps %1, %0" : "+x"(x) : "x"(t)); // x &= t 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fabsf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fabsf(float x) 4 | { 5 | float t; 6 | __asm__ ("pcmpeqd %0, %0" : "=x"(t)); // t = ~0 7 | __asm__ ("psrld $1, %0" : "+x"(t)); // t >>= 1 8 | __asm__ ("andps %1, %0" : "+x"(x) : "x"(t)); // x &= t 9 | return x; 10 | } 11 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cabsl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double cabsl(long double complex z) 5 | { 6 | return cabs(z); 7 | } 8 | #else 9 | long double cabsl(long double complex z) 10 | { 11 | return hypotl(creall(z), cimagl(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cargl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double cargl(long double complex z) 5 | { 6 | return carg(z); 7 | } 8 | #else 9 | long double cargl(long double complex z) 10 | { 11 | return atan2l(cimagl(z), creall(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/res_send.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __res_send(const unsigned char *msg, int msglen, unsigned char *answer, int anslen) 4 | { 5 | int r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen); 6 | return r<0 || !anslen ? -1 : anslen; 7 | } 8 | 9 | weak_alias(__res_send, res_send); 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcsncasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int wcsncasecmp(const wchar_t *l, const wchar_t *r, size_t n) 5 | { 6 | if (!n--) return 0; 7 | for (; *l && *r && n && (*l == *r || towlower(*l) == towlower(*r)); l++, r++, n--); 8 | return towlower(*l) - towlower(*r); 9 | } 10 | -------------------------------------------------------------------------------- /source/kernel/device/timer/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_TIMER_ARM', 'arm_timer'), 11 | ])) 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosh.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | /* acosh(z) = i acos(z) */ 4 | 5 | double complex cacosh(double complex z) 6 | { 7 | int zineg = signbit(cimag(z)); 8 | 9 | z = cacos(z); 10 | if (zineg) return CMPLX(cimag(z), -creal(z)); 11 | else return CMPLX(-cimag(z), creal(z)); 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswgraph.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswgraph(wint_t wc) 4 | { 5 | /* ISO C defines this function as: */ 6 | return !iswspace(wc) && iswprint(wc); 7 | } 8 | 9 | int __iswgraph_l(wint_t c, locale_t l) 10 | { 11 | return iswgraph(c); 12 | } 13 | 14 | weak_alias(__iswgraph_l, iswgraph_l); 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmax.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmax(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? y : x; 12 | return x < y ? y : x; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmaxf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fmaxf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeroes, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? y : x; 12 | return x < y ? y : x; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmin.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double fmin(double x, double y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? x : y; 12 | return x < y ? x : y; 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fminf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float fminf(float x, float y) 4 | { 5 | if (isnan(x)) 6 | return y; 7 | if (isnan(y)) 8 | return x; 9 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 10 | if (signbit(x) != signbit(y)) 11 | return signbit(x) ? x : y; 12 | return x < y ? x : y; 13 | } 14 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arm64/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 generic timer functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | extern void arm64_time_init(void); 14 | -------------------------------------------------------------------------------- /source/kernel/include/net/ipv6.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief IPv6 definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logb.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* 4 | special cases: 5 | logb(+-0) = -inf, and raise divbyzero 6 | logb(+-inf) = +inf 7 | logb(nan) = nan 8 | */ 9 | 10 | double logb(double x) 11 | { 12 | if (!isfinite(x)) 13 | return x * x; 14 | if (x == 0) 15 | return -1/(x*x); 16 | return ilogb(x); 17 | } 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/prng/rand_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static unsigned temper(unsigned x) 4 | { 5 | x ^= x>>11; 6 | x ^= x<<7 & 0x9D2C5680; 7 | x ^= x<<15 & 0xEFC60000; 8 | x ^= x>>18; 9 | return x; 10 | } 11 | 12 | int rand_r(unsigned *seed) 13 | { 14 | return temper(*seed = *seed * 1103515245 + 12345)/2; 15 | } 16 | -------------------------------------------------------------------------------- /source/kernel/device/console/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | config DEVICE_CONSOLE_NS16550 7 | depends on ARCH_ARM64 || ARCH_X86 8 | def_bool y 9 | 10 | config DEVICE_CONSOLE_PL011 11 | depends on ARCH_ARM64 12 | def_bool y 13 | -------------------------------------------------------------------------------- /source/kernel/io/fs/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | menu "Filesystem support" 7 | 8 | config FS_EXT2 9 | bool "Ext2/3/4 filesystem support" 10 | default y 11 | help 12 | Enable support for Ext2/3/4 filesystems. 13 | 14 | endmenu 15 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/param.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Parameter definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #define MAXPATHLEN PATH_MAX 16 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/arm.txt: -------------------------------------------------------------------------------- 1 | aeabi_cdcmpeq 2 | aeabi_cdrcmple 3 | aeabi_cfcmpeq 4 | aeabi_cfrcmple 5 | aeabi_dcmpeq 6 | aeabi_dcmpge 7 | aeabi_dcmpgt 8 | aeabi_dcmple 9 | aeabi_dcmplt 10 | aeabi_drsub 11 | aeabi_fcmpeq 12 | aeabi_fcmpge 13 | aeabi_fcmpgt 14 | aeabi_fcmple 15 | aeabi_fcmplt 16 | aeabi_frsub 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__fpclassifyf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __fpclassifyf(float x) 5 | { 6 | union {float f; uint32_t i;} u = {x}; 7 | int e = u.i>>23 & 0xff; 8 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 9 | if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE; 10 | return FP_NORMAL; 11 | } 12 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/un.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief UNIX socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__fpclassify.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __fpclassify(double x) 5 | { 6 | union {double f; uint64_t i;} u = {x}; 7 | int e = u.i>>52 & 0x7ff; 8 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 9 | if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; 10 | return FP_NORMAL; 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/gethostbyname_r.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | 3 | #include 4 | #include 5 | 6 | int gethostbyname_r(const char *name, 7 | struct hostent *h, char *buf, size_t buflen, 8 | struct hostent **res, int *err) 9 | { 10 | return gethostbyname2_r(name, AF_INET, h, buf, buflen, res, err); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ccosl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex ccosl(long double complex z) 5 | { 6 | return ccos(z); 7 | } 8 | #else 9 | long double complex ccosl(long double complex z) 10 | { 11 | return ccoshl(CMPLXL(-cimagl(z), creall(z))); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /source/kernel/device/irq/arm_gic_v2/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'arm_gic_v2.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /source/kernel/device/timer/arm_timer/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'arm_timer.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacos.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME: Hull et al. "Implementing the complex arcsine and arccosine functions using exception handling" 1997 4 | 5 | /* acos(z) = pi/2 - asin(z) */ 6 | 7 | double complex cacos(double complex z) 8 | { 9 | z = casin(z); 10 | return CMPLX(M_PI_2 - creal(z), -cimag(z)); 11 | } 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wcstok.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | wchar_t *wcstok(wchar_t *restrict s, const wchar_t *restrict sep, wchar_t **restrict p) 4 | { 5 | if (!s && !(s = *p)) return NULL; 6 | s += wcsspn(s, sep); 7 | if (!*s) return *p = 0; 8 | *p = s + wcscspn(s, sep); 9 | if (**p) *(*p)++ = 0; 10 | else *p = 0; 11 | return s; 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/string/wmemmove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) 5 | { 6 | wchar_t *d0 = d; 7 | if (d == s) return d; 8 | if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d) 9 | while (n--) d[n] = s[n]; 10 | else 11 | while (n--) *d++ = *s++; 12 | return d0; 13 | } 14 | -------------------------------------------------------------------------------- /source/kernel/device/irq/bcm2836_l1_irq/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | # Built-in driver. 10 | kern_sources += feature_sources(config, [ 11 | 'bcm2836_l1_irq.c', 12 | ]) 13 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 setjmp definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Jump buffer size. */ 14 | #define JMP_BUF_SIZE 8 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logbl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 3 | long double logbl(long double x) 4 | { 5 | return logb(x); 6 | } 7 | #else 8 | long double logbl(long double x) 9 | { 10 | if (!isfinite(x)) 11 | return x * x; 12 | if (x == 0) 13 | return -1/(x*x); 14 | return ilogbl(x); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /source/bin/utilities/net_control/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['device']) 9 | 10 | env.KiwiApplication('net_control', [ 11 | 'dhcp.c', 12 | 'net_control.c', 13 | 'utility.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/kernel/device/bus/pci/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | 8 | if config['ARCH'] == 'amd64': 9 | pci_platform = 'pc' 10 | 11 | mod_env.Module('pci', [ 12 | 'platform/%s.c' % (pci_platform), 13 | 'pci.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/include/system/arch/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 type definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Word size of the architecture. */ 14 | #define __WORDSIZE 64 15 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 type definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Word size of the architecture. */ 14 | #define __WORDSIZE 64 15 | -------------------------------------------------------------------------------- /source/lib/system/include/alloca.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Automatically freed allocation function. 9 | */ 10 | 11 | #pragma once 12 | 13 | #undef alloca 14 | #define alloca(size) __builtin_alloca(size) 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef FEATURES_H 2 | #define FEATURES_H 3 | 4 | #include "../../include/features.h" 5 | 6 | #define weak __attribute__((__weak__)) 7 | #define hidden __attribute__((__visibility__("hidden"))) 8 | #define weak_alias(old, new) \ 9 | extern __typeof(old) new __attribute__((__weak__, __alias__(#old))) 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arm64/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 KDB definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern void arm64_kdb_brk_handler(frame_t *frame); 16 | -------------------------------------------------------------------------------- /source/kernel/proc/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ipc.c', 11 | 'process.c', 12 | 'sched.c', 13 | 'thread.c', 14 | ]) 15 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/macho_embedded/thumb2.txt: -------------------------------------------------------------------------------- 1 | switch16 2 | switch32 3 | switch8 4 | switchu8 5 | sync_fetch_and_add_4 6 | sync_fetch_and_sub_4 7 | sync_fetch_and_and_4 8 | sync_fetch_and_or_4 9 | sync_fetch_and_xor_4 10 | sync_fetch_and_nand_4 11 | sync_fetch_and_max_4 12 | sync_fetch_and_umax_4 13 | sync_fetch_and_min_4 14 | sync_fetch_and_umin_4 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float nearbyintf(float x) 5 | { 6 | #ifdef FE_INEXACT 7 | #pragma STDC FENV_ACCESS ON 8 | int e; 9 | 10 | e = fetestexcept(FE_INEXACT); 11 | #endif 12 | x = rintf(x); 13 | #ifdef FE_INEXACT 14 | if (!e) 15 | feclearexcept(FE_INEXACT); 16 | #endif 17 | return x; 18 | } 19 | -------------------------------------------------------------------------------- /source/kernel/device/input/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Input devices" 7 | 8 | config DEVICE_INPUT_I8042 9 | bool "i8042 keyboard/mouse port" 10 | default y 11 | depends on ARCH_X86 12 | help 13 | Enable the i8042 (PS/2) keyboard/mouse port driver. 14 | -------------------------------------------------------------------------------- /source/services/service_manager/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi']) 9 | 10 | env.KiwiService('service_manager', [ 11 | 'client.cpp', 12 | 'service_manager.cpp', 13 | 'service.cpp', 14 | ]) 15 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "SConscript": "python", 4 | "SConstruct": "python", 5 | "package.build": "shellscript", 6 | "*.package": "json", 7 | "*.manifest": "json" 8 | }, 9 | "files.exclude": { 10 | ".sconsign.dblite": true 11 | }, 12 | "search.followSymlinks": false, 13 | } 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/remainderl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double remainderl(long double x, long double y) 6 | { 7 | return remainder(x, y); 8 | } 9 | #else 10 | long double remainderl(long double x, long double y) 11 | { 12 | int q; 13 | return remquol(x, y, &q); 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/getservbyname.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | struct servent *getservbyname(const char *name, const char *prots) 5 | { 6 | static struct servent se; 7 | static char *buf[2]; 8 | struct servent *res; 9 | if (getservbyname_r(name, prots, &se, (void *)buf, sizeof buf, &res)) 10 | return 0; 11 | return &se; 12 | } 13 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cpowl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cpowl(long double complex z, long double complex c) 5 | { 6 | return cpow(z, c); 7 | } 8 | #else 9 | long double complex cpowl(long double complex z, long double complex c) 10 | { 11 | return cexpl(c * clogl(z)); 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/getservbyport.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | 4 | struct servent *getservbyport(int port, const char *prots) 5 | { 6 | static struct servent se; 7 | static long buf[32/sizeof(long)]; 8 | struct servent *res; 9 | if (getservbyport_r(port, prots, &se, (void *)buf, sizeof buf, &res)) 10 | return 0; 11 | return &se; 12 | } 13 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Library image loader. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | 18 | 19 | __KERNEL_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /source/lib/system/include/langinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Locale functions/definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | 18 | 19 | __SYS_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinf.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | float complex casinf(float complex z) 6 | { 7 | float complex w; 8 | float x, y; 9 | 10 | x = crealf(z); 11 | y = cimagf(z); 12 | w = CMPLXF(1.0 - (x - y)*(x + y), -2.0*x*y); 13 | float complex r = clogf(CMPLXF(-y, x) + csqrtf(w)); 14 | return CMPLXF(cimagf(r), -crealf(r)); 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/__signbitl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | #if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 4 | int __signbitl(long double x) 5 | { 6 | union ldshape u = {x}; 7 | return u.i.se >> 15; 8 | } 9 | #elif LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 10 | int __signbitl(long double x) 11 | { 12 | return __signbit(x); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /source/kernel/device/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | menu "Device support" 7 | 8 | source "bus/Kconfig" 9 | source "console/Kconfig" 10 | source "disk/Kconfig" 11 | source "input/Kconfig" 12 | source "irq/Kconfig" 13 | source "net/Kconfig" 14 | source "timer/Kconfig" 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /source/kernel/device/irq/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_IRQ_ARM_GIC_V2', 'arm_gic_v2'), 11 | ('DEVICE_IRQ_BCM2836_L1', 'bcm2836_l1_irq'), 12 | ])) 13 | -------------------------------------------------------------------------------- /source/kernel/include/io/memory_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Memory file functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern object_handle_t *memory_file_create(const void *buf, size_t size); 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/csinl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex csinl(long double complex z) 5 | { 6 | return csin(z); 7 | } 8 | #else 9 | long double complex csinl(long double complex z) 10 | { 11 | z = csinhl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/ctanl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex ctanl(long double complex z) 5 | { 6 | return ctan(z); 7 | } 8 | #else 9 | long double complex ctanl(long double complex z) 10 | { 11 | z = ctanhl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswcntrl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iswcntrl(wint_t wc) 4 | { 5 | return (unsigned)wc < 32 6 | || (unsigned)(wc-0x7f) < 33 7 | || (unsigned)(wc-0x2028) < 2 8 | || (unsigned)(wc-0xfff9) < 3; 9 | } 10 | 11 | int __iswcntrl_l(wint_t c, locale_t l) 12 | { 13 | return iswcntrl(c); 14 | } 15 | 16 | weak_alias(__iswcntrl_l, iswcntrl_l); 17 | -------------------------------------------------------------------------------- /source/kernel/device/input/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('input', [ 10 | 'input.c', 11 | ]) 12 | 13 | SConscript(dirs = feature_dirs(config, [ 14 | ('DEVICE_INPUT_I8042', 'i8042'), 15 | ])) 16 | -------------------------------------------------------------------------------- /source/services/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | 8 | if config['SYS_MINIMAL_USERSPACE']: 9 | Return() 10 | 11 | dirs = [ 12 | 'posix_service', 13 | 'service_manager', 14 | 'terminal_service', 15 | 'test', 16 | ] 17 | 18 | SConscript(dirs = dirs) 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fabsl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 3 | long double fabsl(long double x) 4 | { 5 | return fabs(x); 6 | } 7 | #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 8 | long double fabsl(long double x) 9 | { 10 | union ldshape u = {x}; 11 | 12 | u.i.se &= 0x7fff; 13 | return u.f; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /source/kernel/device/bus/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | from util import feature_dirs 8 | 9 | SConscript(dirs = feature_dirs(config, [ 10 | ('DEVICE_BUS_DT', 'dt'), 11 | ('DEVICE_BUS_PCI', 'pci'), 12 | ('DEVICE_BUS_VIRTIO', 'virtio'), 13 | ])) 14 | -------------------------------------------------------------------------------- /source/kernel/include/sync/futex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Futex implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | struct process; 16 | 17 | extern void futex_process_cleanup(struct process *proc); 18 | -------------------------------------------------------------------------------- /source/services/posix_service/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi']) 9 | 10 | env.KiwiService('posix_service', [ 11 | 'posix_service.cpp', 12 | 'process_group.cpp', 13 | 'process.cpp', 14 | 'session.cpp', 15 | ]) 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex casinhl(long double complex z) 5 | { 6 | return casinh(z); 7 | } 8 | #else 9 | long double complex casinhl(long double complex z) 10 | { 11 | z = casinl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/catanhl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex catanhl(long double complex z) 5 | { 6 | return catanh(z); 7 | } 8 | #else 9 | long double complex catanhl(long double complex z) 10 | { 11 | z = catanl(CMPLXL(-cimagl(z), creall(z))); 12 | return CMPLXL(cimagl(z), -creall(z)); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 setjmp() definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Type of the buffer for setjmp(). */ 16 | typedef unsigned long jmp_buf[8]; 17 | -------------------------------------------------------------------------------- /source/kernel/device/net/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | # Note that net.c is compiled as part of the net module. 10 | 11 | SConscript(dirs = feature_dirs(config, [ 12 | ('DEVICE_NET_VIRTIO_NET', 'virtio_net'), 13 | ])) 14 | -------------------------------------------------------------------------------- /source/bin/utilities/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | dirs = [ 9 | 'net_control', 10 | ] 11 | 12 | SConscript(dirs = dirs) 13 | 14 | env = manager.create(libraries = []) 15 | 16 | env.KiwiApplication('mount', ['mount.c']) 17 | env.KiwiApplication('unmount', ['unmount.c']) 18 | -------------------------------------------------------------------------------- /source/kernel/device/console/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | ('DEVICE_CONSOLE_NS16550', 'ns16550.c'), 11 | ('DEVICE_CONSOLE_PL011', 'pl011.c'), 12 | 'serial.c', 13 | ]) 14 | -------------------------------------------------------------------------------- /source/kernel/io/fs/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_dirs, feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ramfs.c', 11 | ]) 12 | 13 | SConscript(dirs = feature_dirs(config, [ 14 | ('FS_EXT2', 'ext2'), 15 | ])) 16 | -------------------------------------------------------------------------------- /source/lib/system/include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief TCP socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | #define TCP_NODELAY 1 18 | 19 | __SYS_EXTERN_C_BEGIN 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/truncf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float truncf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f + 9; 7 | uint32_t m; 8 | 9 | if (e >= 23 + 9) 10 | return x; 11 | if (e < 9) 12 | e = 1; 13 | m = -1U >> e; 14 | if ((u.i & m) == 0) 15 | return x; 16 | FORCE_EVAL(x + 0x1p120f); 17 | u.i &= ~m; 18 | return u.f; 19 | } 20 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 CPU cache definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** CPU cache line shift/size. */ 14 | #define CPU_CACHE_SHIFT 6 15 | #define CPU_CACHE_SIZE (1 << CPU_CACHE_SHIFT) 16 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 kernel debugger definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Number of breakpoints supported. */ 14 | #define KDB_BREAKPOINT_COUNT 4 15 | #define KDB_WATCHPOINT_COUNT 4 16 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 CPU cache definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** CPU cache line shift/size. */ 14 | #define CPU_CACHE_SHIFT 6 15 | #define CPU_CACHE_SIZE (1 << CPU_CACHE_SHIFT) 16 | -------------------------------------------------------------------------------- /source/kernel/device/timer/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Timer devices" 7 | 8 | config DEVICE_TIMER_ARM 9 | bool "ARM Generic Timer" 10 | default y 11 | depends on DEVICE_BUS_DT && ARCH_ARM64 12 | help 13 | Enable the driver for the ARM Generic Timer defined in the ARMv7/8 14 | architectures. 15 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/clogl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex clogl(long double complex z) 5 | { 6 | return clog(z); 7 | } 8 | #else 9 | // FIXME 10 | long double complex clogl(long double complex z) 11 | { 12 | long double r, phi; 13 | 14 | r = cabsl(z); 15 | phi = cargl(z); 16 | return CMPLXL(logl(r), phi); 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/__flt_rounds.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int __flt_rounds() 5 | { 6 | switch (fegetround()) { 7 | #ifdef FE_TOWARDZERO 8 | case FE_TOWARDZERO: return 0; 9 | #endif 10 | case FE_TONEAREST: return 1; 11 | #ifdef FE_UPWARD 12 | case FE_UPWARD: return 2; 13 | #endif 14 | #ifdef FE_DOWNWARD 15 | case FE_DOWNWARD: return 3; 16 | #endif 17 | } 18 | return -1; 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/locale/wcscoll.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "locale_impl.h" 4 | 5 | /* FIXME: stub */ 6 | int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) 7 | { 8 | return wcscmp(l, r); 9 | } 10 | 11 | int wcscoll(const wchar_t *l, const wchar_t *r) 12 | { 13 | return __wcscoll_l(l, r, CURRENT_LOCALE); 14 | } 15 | 16 | weak_alias(__wcscoll_l, wcscoll_l); 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fdiml.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fdiml(long double x, long double y) 6 | { 7 | return fdim(x, y); 8 | } 9 | #else 10 | long double fdiml(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return x; 14 | if (isnan(y)) 15 | return y; 16 | return x > y ? x - y : 0; 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/trunc.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | double trunc(double x) 4 | { 5 | union {double f; uint64_t i;} u = {x}; 6 | int e = (int)(u.i >> 52 & 0x7ff) - 0x3ff + 12; 7 | uint64_t m; 8 | 9 | if (e >= 52 + 12) 10 | return x; 11 | if (e < 12) 12 | e = 1; 13 | m = -1ULL >> e; 14 | if ((u.i & m) == 0) 15 | return x; 16 | FORCE_EVAL(x + 0x1p120f); 17 | u.i &= ~m; 18 | return u.f; 19 | } 20 | -------------------------------------------------------------------------------- /source/kernel/device/bus/virtio/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('virtio', [ 10 | 'virtio.c', 11 | ]) 12 | 13 | if config['DEVICE_BUS_VIRTIO_PCI']: 14 | mod_env.Module('virtio_pci', [ 15 | 'virtio_pci.c', 16 | ]) 17 | -------------------------------------------------------------------------------- /source/lib/system/sched.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Scheduling functions. 9 | */ 10 | 11 | #include 12 | 13 | /** Yield the processor. 14 | * @return Always returns 0. */ 15 | int sched_yield(void) { 16 | /* TODO */ 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cprojl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cprojl(long double complex z) 5 | { 6 | return cproj(z); 7 | } 8 | #else 9 | long double complex cprojl(long double complex z) 10 | { 11 | if (isinf(creall(z)) || isinf(cimagl(z))) 12 | return CMPLXL(INFINITY, copysignl(0.0, cimagl(z))); 13 | return z; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswpunct.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const unsigned char table[] = { 4 | #include "punct.h" 5 | }; 6 | 7 | int iswpunct(wint_t wc) 8 | { 9 | if (wc<0x20000U) 10 | return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1; 11 | return 0; 12 | } 13 | 14 | int __iswpunct_l(wint_t c, locale_t l) 15 | { 16 | return iswpunct(c); 17 | } 18 | 19 | weak_alias(__iswpunct_l, iswpunct_l); 20 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/kdb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 kernel debugger definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Number of breakpoints supported. */ 14 | // TODO 15 | #define KDB_BREAKPOINT_COUNT 4 16 | #define KDB_WATCHPOINT_COUNT 4 17 | -------------------------------------------------------------------------------- /source/lib/system/include/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Scheduling definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #include 16 | 17 | __SYS_EXTERN_C_BEGIN 18 | 19 | extern int sched_yield(void); 20 | 21 | __SYS_EXTERN_C_END 22 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Random number generation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern int getentropy(void *buffer, size_t length); 18 | 19 | __SYS_EXTERN_C_END 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casin.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | // FIXME 4 | 5 | /* asin(z) = -i log(i z + sqrt(1 - z*z)) */ 6 | 7 | double complex casin(double complex z) 8 | { 9 | double complex w; 10 | double x, y; 11 | 12 | x = creal(z); 13 | y = cimag(z); 14 | w = CMPLX(1.0 - (x - y)*(x + y), -2.0*x*y); 15 | double complex r = clog(CMPLX(-y, x) + csqrt(w)); 16 | return CMPLX(cimag(r), -creal(r)); 17 | } 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/h_errno.c: -------------------------------------------------------------------------------- 1 | #include 2 | #ifdef __Kiwi__ 3 | static __thread int __h_errno = 0; 4 | #else 5 | #include "pthread_impl.h" 6 | 7 | #undef h_errno 8 | int h_errno; 9 | #endif 10 | 11 | int *__h_errno_location(void) 12 | { 13 | #ifdef __Kiwi__ 14 | return &__h_errno; 15 | #else 16 | if (!__pthread_self()->stack) return &h_errno; 17 | return &__pthread_self()->h_errno_val; 18 | #endif 19 | } 20 | -------------------------------------------------------------------------------- /source/kernel/sync/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'condition.c', 11 | 'condvar.c', 12 | 'futex.c', 13 | 'mutex.c', 14 | 'rwlock.c', 15 | 'semaphore.c', 16 | 'spinlock.c', 17 | ]) 18 | -------------------------------------------------------------------------------- /source/kernel/include/device/console/pl011.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief PL011 console implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #if CONFIG_DEVICE_CONSOLE_PL011 16 | extern const serial_port_ops_t pl011_serial_port_ops; 17 | #endif 18 | -------------------------------------------------------------------------------- /source/services/terminal_service/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['kiwi'], flags = { 9 | 'CPPPATH': [ 10 | Dir('../../lib/system'), 11 | ], 12 | }) 13 | 14 | env.KiwiService('terminal_service', [ 15 | 'terminal_service.cpp', 16 | 'terminal.cpp', 17 | ]) 18 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdisf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | #if defined(__x86_64__) || defined(_M_X64) 6 | 7 | #include "../int_lib.h" 8 | 9 | float __floatdisf(int64_t a) { return (float)a; } 10 | 11 | #endif // __x86_64__ 12 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacosl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cacosl(long double complex z) 5 | { 6 | return cacos(z); 7 | } 8 | #else 9 | // FIXME 10 | #define PI_2 1.57079632679489661923132169163975144L 11 | long double complex cacosl(long double complex z) 12 | { 13 | z = casinl(z); 14 | return CMPLXL(PI_2 - creall(z), -cimagl(z)); 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/sqrt_data.h: -------------------------------------------------------------------------------- 1 | #ifndef _SQRT_DATA_H 2 | #define _SQRT_DATA_H 3 | 4 | #include 5 | #include 6 | 7 | /* if x in [1,2): i = (int)(64*x); 8 | if x in [2,4): i = (int)(32*x-64); 9 | __rsqrt_tab[i]*2^-16 is estimating 1/sqrt(x) with small relative error: 10 | |__rsqrt_tab[i]*0x1p-16*sqrt(x) - 1| < -0x1.fdp-9 < 2^-8 */ 11 | extern hidden const uint16_t __rsqrt_tab[128]; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /source/kernel/device/net/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Network devices" 7 | 8 | config DEVICE_NET_VIRTIO_NET 9 | bool "VirtIO network device" 10 | default y 11 | depends on DEVICE_BUS_VIRTIO 12 | help 13 | Enable support for VirtIO network devices implemented by virtual machines 14 | such as QEMU and VirtualBox. 15 | 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/multibyte/mbrtoc32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | size_t mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n, mbstate_t *restrict ps) 5 | { 6 | static unsigned internal_state; 7 | if (!ps) ps = (void *)&internal_state; 8 | if (!s) return mbrtoc32(0, "", 1, ps); 9 | wchar_t wc; 10 | size_t ret = mbrtowc(&wc, s, n, ps); 11 | if (ret <= 4 && pc32) *pc32 = wc; 12 | return ret; 13 | } 14 | -------------------------------------------------------------------------------- /source/lib/system/include/libgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Pattern matching functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern char *basename(char *path); 18 | extern char *dirname(char *path); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/scalblnl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 6 | long double scalblnl(long double x, long n) 7 | { 8 | return scalbln(x, n); 9 | } 10 | #else 11 | long double scalblnl(long double x, long n) 12 | { 13 | if (n > INT_MAX) 14 | n = INT_MAX; 15 | else if (n < INT_MIN) 16 | n = INT_MIN; 17 | return scalbnl(x, n); 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /source/kernel/mm/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'kmem.c', 11 | 'malloc.c', 12 | 'mmu.c', 13 | 'page.c', 14 | 'page_cache.c', 15 | 'phys.c', 16 | 'safe.c', 17 | 'slab.c', 18 | 'vm.c', 19 | ]) 20 | -------------------------------------------------------------------------------- /source/lib/system/arch/amd64/include/system/arch/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 POSIX definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** POSIX environment definitions. */ 14 | #define _POSIX_V7_LP64_OFF64 1 15 | #define _POSIX_V6_LP64_OFF64 1 16 | #define _XBS5_LP64_OFF64 1 17 | -------------------------------------------------------------------------------- /source/lib/system/arch/arm64/include/system/arch/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 POSIX definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** POSIX environment definitions. */ 14 | #define _POSIX_V7_LP64_OFF64 1 15 | #define _POSIX_V6_LP64_OFF64 1 16 | #define _XBS5_LP64_OFF64 1 17 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/weak.exp: -------------------------------------------------------------------------------- 1 | __ZTISt10bad_typeid 2 | __ZTISt11logic_error 3 | __ZTISt11range_error 4 | __ZTISt12domain_error 5 | __ZTISt12length_error 6 | __ZTISt12out_of_range 7 | __ZTISt13bad_exception 8 | __ZTISt13runtime_error 9 | __ZTISt14overflow_error 10 | __ZTISt15underflow_error 11 | __ZTISt16invalid_argument 12 | __ZTISt16nested_exception 13 | __ZTISt20bad_array_new_length 14 | __ZTISt8bad_cast 15 | __ZTISt9bad_alloc 16 | __ZTISt9exception 17 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyint.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* nearbyint is the same as rint, but it must not raise the inexact exception */ 5 | 6 | double nearbyint(double x) 7 | { 8 | #ifdef FE_INEXACT 9 | #pragma STDC FENV_ACCESS ON 10 | int e; 11 | 12 | e = fetestexcept(FE_INEXACT); 13 | #endif 14 | x = rint(x); 15 | #ifdef FE_INEXACT 16 | if (!e) 17 | feclearexcept(FE_INEXACT); 18 | #endif 19 | return x; 20 | } 21 | -------------------------------------------------------------------------------- /source/bin/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config') 7 | 8 | minimal_bins = [ 9 | 'test', 10 | ] 11 | 12 | SConscript(dirs = minimal_bins) 13 | 14 | if config['SYS_MINIMAL_USERSPACE']: 15 | Return() 16 | 17 | bins = [ 18 | 'dungeon', 19 | 'posix', 20 | 'terminal', 21 | 'utilities', 22 | ] 23 | 24 | SConscript(dirs = bins) 25 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/ctype/iswalpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const unsigned char table[] = { 4 | #include "alpha.h" 5 | }; 6 | 7 | int iswalpha(wint_t wc) 8 | { 9 | if (wc<0x20000U) 10 | return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1; 11 | if (wc<0x2fffeU) 12 | return 1; 13 | return 0; 14 | } 15 | 16 | int __iswalpha_l(wint_t c, locale_t l) 17 | { 18 | return iswalpha(c); 19 | } 20 | 21 | weak_alias(__iswalpha_l, iswalpha_l); 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/locale/c_locale.c: -------------------------------------------------------------------------------- 1 | #include "locale_impl.h" 2 | #include 3 | 4 | static const uint32_t empty_mo[] = { 0x950412de, 0, -1, -1, -1 }; 5 | 6 | const struct __locale_map __c_dot_utf8 = { 7 | .map = empty_mo, 8 | .map_size = sizeof empty_mo, 9 | .name = "C.UTF-8" 10 | }; 11 | 12 | const struct __locale_struct __c_locale = { 0 }; 13 | const struct __locale_struct __c_dot_utf8_locale = { 14 | .cat[LC_CTYPE] = &__c_dot_utf8 15 | }; 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/freeaddrinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "lookup.h" 5 | #include "lock.h" 6 | 7 | void freeaddrinfo(struct addrinfo *p) 8 | { 9 | size_t cnt; 10 | for (cnt=1; p->ai_next; cnt++, p=p->ai_next); 11 | struct aibuf *b = (void *)((char *)p - offsetof(struct aibuf, ai)); 12 | b -= b->slot; 13 | LOCK(b->lock); 14 | if (!(b->ref -= cnt)) free(b); 15 | else UNLOCK(b->lock); 16 | } 17 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/device/bus/dt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Device Tree bus interface. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** DT device class name. */ 18 | #define DT_DEVICE_CLASS_NAME "dt_device" 19 | 20 | __KERNEL_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | sysroot_env = manager['sysroot'] 9 | 10 | crt_files = ['crt1', 'crti', 'crtn'] 11 | 12 | for file in crt_files: 13 | path = '%s/%s.o' % (str(env['_LIBOUTDIR']), file) 14 | env.Object(path, ['%s.S' % (file)]) 15 | sysroot_env.AddFile(File(path), 'lib/%s.o' % (file)) 16 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | sysroot_env = manager['sysroot'] 9 | 10 | crt_files = ['crt1', 'crti', 'crtn'] 11 | 12 | for file in crt_files: 13 | path = '%s/%s.o' % (str(env['_LIBOUTDIR']), file) 14 | env.Object(path, ['%s.S' % (file)]) 15 | sysroot_env.AddFile(File(path), 'lib/%s.o' % (file)) 16 | -------------------------------------------------------------------------------- /utilities/image_tool/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('env', 'manager') 7 | 8 | env.Command( 9 | 'mbr.bin.c', 10 | ['mbr.bin'], 11 | Action('$BIN2HEX $SOURCE mbr_bin > $TARGET', '$GENCOMSTR')) 12 | 13 | env.Program('image_tool', [ 14 | 'image_tool.c', 15 | 'mbr.bin.c', 16 | ]) 17 | 18 | manager.add_variable('IMAGE_TOOL', File('image_tool')) 19 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdixf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | // long double __floatdixf(di_int a); 6 | 7 | #ifdef __x86_64__ 8 | 9 | #include "../int_lib.h" 10 | 11 | long double __floatdixf(int64_t a) { return (long double)a; } 12 | 13 | #endif // __i386__ 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/cacoshl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex cacoshl(long double complex z) 5 | { 6 | return cacosh(z); 7 | } 8 | #else 9 | long double complex cacoshl(long double complex z) 10 | { 11 | int zineg = signbit(cimagl(z)); 12 | 13 | z = cacosl(z); 14 | if (zineg) return CMPLXL(cimagl(z), -creall(z)); 15 | else return CMPLXL(-cimagl(z), creall(z)); 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fmaf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if __FMA__ 4 | 5 | float fmaf(float x, float y, float z) 6 | { 7 | __asm__ ("vfmadd132ss %1, %2, %0" : "+x" (x) : "x" (y), "x" (z)); 8 | return x; 9 | } 10 | 11 | #elif __FMA4__ 12 | 13 | float fmaf(float x, float y, float z) 14 | { 15 | __asm__ ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); 16 | return x; 17 | } 18 | 19 | #else 20 | 21 | #include "../fmaf.c" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/log2f_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, Arm Limited. 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | #ifndef _LOG2F_DATA_H 6 | #define _LOG2F_DATA_H 7 | 8 | #include 9 | 10 | #define LOG2F_TABLE_BITS 4 11 | #define LOG2F_POLY_ORDER 4 12 | extern hidden const struct log2f_data { 13 | struct { 14 | double invc, logc; 15 | } tab[1 << LOG2F_TABLE_BITS]; 16 | double poly[LOG2F_POLY_ORDER]; 17 | } __log2f_data; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/fma.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if __FMA__ 4 | 5 | double fma(double x, double y, double z) 6 | { 7 | __asm__ ("vfmadd132sd %1, %2, %0" : "+x" (x) : "x" (y), "x" (z)); 8 | return x; 9 | } 10 | 11 | #elif __FMA4__ 12 | 13 | double fma(double x, double y, double z) 14 | { 15 | __asm__ ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); 16 | return x; 17 | } 18 | 19 | #else 20 | 21 | #include "../fma.c" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /source/kernel/device/disk/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'mod_env') 7 | from util import feature_dirs 8 | 9 | mod_env.Module('disk', [ 10 | 'disk.c', 11 | 'gpt.c', 12 | 'mbr.c', 13 | 'partition.c', 14 | ]) 15 | 16 | SConscript(dirs = feature_dirs(config, [ 17 | ('DEVICE_DISK_ATA', 'ata'), 18 | ('DEVICE_DISK_PCI_ATA', 'pci_ata'), 19 | ])) 20 | -------------------------------------------------------------------------------- /source/lib/system/include/core/path.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Path manipulation functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | extern char *core_path_basename(const char *path); 18 | extern char *core_path_dirname(const char *path); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/x86_64/floatdidf.c: -------------------------------------------------------------------------------- 1 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 2 | // See https://llvm.org/LICENSE.txt for license information. 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | 5 | // double __floatdidf(di_int a); 6 | 7 | #if defined(__x86_64__) || defined(_M_X64) 8 | 9 | #include "../int_lib.h" 10 | 11 | double __floatdidf(int64_t a) { return (double)a; } 12 | 13 | #endif // __x86_64__ 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/frexpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | float frexpf(float x, int *e) 5 | { 6 | union { float f; uint32_t i; } y = { x }; 7 | int ee = y.i>>23 & 0xff; 8 | 9 | if (!ee) { 10 | if (x) { 11 | x = frexpf(x*0x1p64, e); 12 | *e -= 64; 13 | } else *e = 0; 14 | return x; 15 | } else if (ee == 0xff) { 16 | return x; 17 | } 18 | 19 | *e = ee - 0x7e; 20 | y.i &= 0x807ffffful; 21 | y.i |= 0x3f000000ul; 22 | return y.f; 23 | } 24 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crt1.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 application startup code. 9 | */ 10 | 11 | .section .text 12 | 13 | /** Main program entry point. */ 14 | .global _start 15 | .type _start, @function 16 | _start: 17 | jmp libsystem_main 18 | .size _start, .-_start 19 | 20 | .section ".note.GNU-stack", "", @progbits 21 | -------------------------------------------------------------------------------- /source/lib/crt/arch/arm64/crt1.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 application startup code. 9 | */ 10 | 11 | .section .text 12 | 13 | /** Main program entry point. */ 14 | .global _start 15 | .type _start, @function 16 | _start: 17 | b libsystem_main 18 | .size _start, .-_start 19 | 20 | .section ".note.GNU-stack", "", @progbits 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/copysignl.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double copysignl(long double x, long double y) 5 | { 6 | return copysign(x, y); 7 | } 8 | #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 9 | long double copysignl(long double x, long double y) 10 | { 11 | union ldshape ux = {x}, uy = {y}; 12 | ux.i.se &= 0x7fff; 13 | ux.i.se |= uy.i.se & 0x8000; 14 | return ux.f; 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 setjmp() definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** 16 | * Type of the buffer for setjmp(). In the kernel we don't use floating point 17 | * so no need to store those here. 18 | */ 19 | typedef unsigned long jmp_buf[13]; 20 | -------------------------------------------------------------------------------- /source/lib/device/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager', 'config') 7 | 8 | env = manager.create(flags = { 9 | 'CPPPATH': [ 10 | Dir('include'), 11 | ], 12 | }) 13 | 14 | sources = [ 15 | 'device.c', 16 | 'input.c', 17 | 'net.c', 18 | ] 19 | 20 | env.KiwiLibrary('device', 21 | sources = sources, 22 | include_paths = [Dir('include')], 23 | ) 24 | -------------------------------------------------------------------------------- /source/lib/system/include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Device control function. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Some things that use this expect termios.h to be included by it. */ 14 | #include 15 | 16 | __SYS_EXTERN_C_BEGIN 17 | 18 | extern int ioctl(int fd, int request, ...); 19 | 20 | __SYS_EXTERN_C_END 21 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/pipe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Pipe functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | extern status_t kern_pipe_create( 18 | uint32_t read_flags, uint32_t write_flags, handle_t *_read, 19 | handle_t *_write); 20 | 21 | __KERNEL_EXTERN_C_END 22 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crti.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 C runtime. 9 | */ 10 | 11 | .section .init 12 | .global _init 13 | .type _init, @function 14 | _init: 15 | subq $8, %rsp 16 | 17 | .section .fini 18 | .global _fini 19 | .type _fini, @function 20 | _fini: 21 | subq $8, %rsp 22 | 23 | .section ".note.GNU-stack", "", @progbits 24 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/ryu/README.txt: -------------------------------------------------------------------------------- 1 | The code in this directory is based on Ulf Adams's work. The upstream for the 2 | code is: 3 | 4 | https://github.com/ulfjack/ryu/tree/59661c3/ryu 5 | 6 | The code has been adapted by Stephan T. Lavavej of Microsoft for usage in 7 | std::to_chars. This code has been contributed by Microsoft for inclusion in 8 | libc++. 9 | 10 | The code in this directory has a different coding style than other parts to 11 | minimize the number of changes by both upstream sources. 12 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 memory barrier functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #define memory_barrier() __asm__ volatile("mfence" ::: "memory") 14 | #define read_barrier() __asm__ volatile("lfence" ::: "memory") 15 | #define write_barrier() __asm__ volatile("sfence" ::: "memory") 16 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/x86/smp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief x86 SMP definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | struct cpu; 14 | 15 | /** x86-specific SMP boot status values. */ 16 | #define SMP_BOOT_TSC_SYNC1 4 /**< Stage 1 of TSC synchronization. */ 17 | #define SMP_BOOT_TSC_SYNC2 5 /**< Stage 2 of TSC synchronization. */ 18 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 memory barrier functions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #define memory_barrier() __asm__ volatile("dsb sy" ::: "memory") 14 | #define read_barrier() __asm__ volatile("dsb ld" ::: "memory") 15 | #define write_barrier() __asm__ volatile("dsb st" ::: "memory") 16 | -------------------------------------------------------------------------------- /source/lib/crt/arch/amd64/crtn.S: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 C runtime. 9 | */ 10 | 11 | .section .init 12 | .global _init 13 | .type _init, @function 14 | addq $8, %rsp 15 | ret 16 | 17 | .section .fini 18 | .global _fini 19 | .type _fini, @function 20 | addq $8, %rsp 21 | ret 22 | 23 | .section ".note.GNU-stack", "", @progbits 24 | -------------------------------------------------------------------------------- /3rdparty/lib/libunwind/docs/README.txt: -------------------------------------------------------------------------------- 1 | libunwind Documentation 2 | ==================== 3 | 4 | The libunwind documentation is written using the Sphinx documentation generator. It is 5 | currently tested with Sphinx 1.1.3. 6 | 7 | To build the documents into html configure libunwind with the following cmake options: 8 | 9 | * -DLLVM_ENABLE_SPHINX=ON 10 | * -DLIBUNWIND_INCLUDE_DOCS=ON 11 | 12 | After configuring libunwind with these options the make rule `docs-libunwind-html` 13 | should be available. 14 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fesetround.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* __fesetround wrapper for arch independent argument check */ 5 | 6 | hidden int __fesetround(int); 7 | 8 | int fesetround(int r) 9 | { 10 | if (r != FE_TONEAREST 11 | #ifdef FE_DOWNWARD 12 | && r != FE_DOWNWARD 13 | #endif 14 | #ifdef FE_UPWARD 15 | && r != FE_UPWARD 16 | #endif 17 | #ifdef FE_TOWARDZERO 18 | && r != FE_TOWARDZERO 19 | #endif 20 | ) 21 | return -1; 22 | return __fesetround(r); 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/frexp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | double frexp(double x, int *e) 5 | { 6 | union { double d; uint64_t i; } y = { x }; 7 | int ee = y.i>>52 & 0x7ff; 8 | 9 | if (!ee) { 10 | if (x) { 11 | x = frexp(x*0x1p64, e); 12 | *e -= 64; 13 | } else *e = 0; 14 | return x; 15 | } else if (ee == 0x7ff) { 16 | return x; 17 | } 18 | 19 | *e = ee - 0x3fe; 20 | y.i &= 0x800fffffffffffffull; 21 | y.i |= 0x3fe0000000000000ull; 22 | return y.d; 23 | } 24 | -------------------------------------------------------------------------------- /source/kernel/include/lib/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Random number generation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern uint64_t random_get_u64(void); 16 | extern int64_t random_get_s64(void); 17 | extern uint32_t random_get_u32(void); 18 | extern int32_t random_get_s32(void); 19 | 20 | extern void random_init(void); 21 | -------------------------------------------------------------------------------- /source/lib/system/string/ffs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Find first set bit function. 9 | */ 10 | 11 | #include 12 | 13 | /** Find the first bit set in a value. 14 | * @param i Value to search in. 15 | * @return Position of first set bit + 1, or 0 if none set. */ 16 | int ffs(int i) { 17 | return __builtin_ffs(i); 18 | } 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/x86_64/floorl.s: -------------------------------------------------------------------------------- 1 | .global floorl 2 | .type floorl,@function 3 | floorl: 4 | fldt 8(%rsp) 5 | 1: mov $0x7,%al 6 | 1: fstcw 8(%rsp) 7 | mov 9(%rsp),%ah 8 | mov %al,9(%rsp) 9 | fldcw 8(%rsp) 10 | frndint 11 | mov %ah,9(%rsp) 12 | fldcw 8(%rsp) 13 | ret 14 | 15 | .global ceill 16 | .type ceill,@function 17 | ceill: 18 | fldt 8(%rsp) 19 | mov $0xb,%al 20 | jmp 1b 21 | 22 | .global truncl 23 | .type truncl,@function 24 | truncl: 25 | fldt 8(%rsp) 26 | mov $0xf,%al 27 | jmp 1b 28 | -------------------------------------------------------------------------------- /source/lib/system/stdio/tmpfile.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Temporary file creation function. 9 | */ 10 | 11 | #include 12 | 13 | #include "libsystem.h" 14 | 15 | FILE *tmpfile(void) { 16 | libsystem_stub("tmpfile", true); 17 | return NULL; 18 | } 19 | 20 | char *tmpnam(char *s) { 21 | libsystem_stub("tmpnam", true); 22 | return NULL; 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/libc++unexp.exp: -------------------------------------------------------------------------------- 1 | # all guard variables 2 | __ZGVNSt3__* 3 | # all vtables 4 | # __ZTV* 5 | # all VTT 6 | # __ZTT* 7 | # all non-virtual thunks 8 | # __ZTh* 9 | # all virtual thunks 10 | # __ZTv* 11 | # typeinfo for std::__1::__types 12 | # There are no std::__types 13 | # __ZTINSt3__1[0-9][0-9]*__* 14 | # typeinfo name for std::__1::__types 15 | __ZTSNSt3__1[0-9][0-9]*__* 16 | # anything using __hidden_allocator 17 | *__hidden_allocator* 18 | # anything using __sso_allocator 19 | *__sso_allocator* 20 | -------------------------------------------------------------------------------- /source/bin/terminal/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create(libraries = ['device', 'freetype', 'kiwi']) 9 | 10 | env.KiwiApplication('terminal', [ 11 | 'font.cpp', 12 | 'framebuffer.cpp', 13 | 'keyboard.cpp', 14 | 'keys.c', 15 | 'terminal_app.cpp', 16 | 'terminal_buffer.cpp', 17 | 'terminal_window.cpp', 18 | 'terminal.cpp', 19 | 'xterm.cpp', 20 | ]) 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/logf_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, Arm Limited. 3 | * SPDX-License-Identifier: MIT 4 | */ 5 | #ifndef _LOGF_DATA_H 6 | #define _LOGF_DATA_H 7 | 8 | #include 9 | 10 | #define LOGF_TABLE_BITS 4 11 | #define LOGF_POLY_ORDER 4 12 | extern hidden const struct logf_data { 13 | struct { 14 | double invc, logc; 15 | } tab[1 << LOGF_TABLE_BITS]; 16 | double ln2; 17 | double poly[LOGF_POLY_ORDER - 1]; /* First order coefficient is 1. */ 18 | } __logf_data; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/Darwin-excludes/osx-i386.txt: -------------------------------------------------------------------------------- 1 | absvti2 2 | addvti3 3 | ashlti3 4 | ashrti3 5 | clzti2 6 | cmpti2 7 | ctzti2 8 | divti3 9 | ffsti2 10 | fixdfti 11 | fixsfti 12 | fixunsdfti 13 | fixunssfti 14 | fixunsxfti 15 | fixxfti 16 | floattidf 17 | floattisf 18 | floattixf 19 | floatuntidf 20 | floatuntisf 21 | floatuntixf 22 | lshrti3 23 | modti3 24 | muloti4 25 | multi3 26 | mulvti3 27 | negti2 28 | negvti2 29 | parityti2 30 | popcountti2 31 | subvti3 32 | ucmpti2 33 | udivmodti4 34 | udivti3 35 | umodti3 36 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fmaxl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fmaxl(long double x, long double y) 6 | { 7 | return fmax(x, y); 8 | } 9 | #else 10 | long double fmaxl(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return y; 14 | if (isnan(y)) 15 | return x; 16 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 17 | if (signbit(x) != signbit(y)) 18 | return signbit(x) ? y : x; 19 | return x < y ? y : x; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/fminl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double fminl(long double x, long double y) 6 | { 7 | return fmin(x, y); 8 | } 9 | #else 10 | long double fminl(long double x, long double y) 11 | { 12 | if (isnan(x)) 13 | return y; 14 | if (isnan(y)) 15 | return x; 16 | /* handle signed zeros, see C99 Annex F.9.9.2 */ 17 | if (signbit(x) != signbit(y)) 18 | return signbit(x) ? x : y; 19 | return x < y ? x : y; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /source/kernel/include/syscall.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief System call dispatcher. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Structure describing a system call handler. */ 16 | typedef struct __packed syscall { 17 | ptr_t addr; /**< Address of handler. */ 18 | size_t count; /**< Number of arguments. */ 19 | } syscall_t; 20 | -------------------------------------------------------------------------------- /source/lib/kiwi/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager', 'config') 7 | 8 | env = manager.create(flags = { 9 | 'CPPPATH': [ 10 | Dir('include'), 11 | ], 12 | }) 13 | 14 | sources = [ 15 | 'core/event_loop.cpp', 16 | ] 17 | 18 | # TODO: Split this into separate libraries once we have more (e.g. kiwi-core). 19 | env.KiwiLibrary('kiwi', 20 | sources = sources, 21 | include_paths = [Dir('include')], 22 | ) 23 | -------------------------------------------------------------------------------- /source/lib/system/stdio/fflush.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief File stream flush function. 9 | */ 10 | 11 | #include 12 | 13 | #include "stdio/stdio.h" 14 | 15 | /** Flush a file stream's buffer. 16 | * @param stream File stream to flush. 17 | * @return 0 on success, EOF on failure. */ 18 | int fflush(FILE *stream) { 19 | /* TODO */ 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/riscv/muldi3.S: -------------------------------------------------------------------------------- 1 | //===--- muldi3.S - Integer multiplication routines -----------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | #if __riscv_xlen == 64 9 | #define __mulxi3 __muldi3 10 | #include "int_mul_impl.inc" 11 | #endif 12 | -------------------------------------------------------------------------------- /source/kernel/include/device/console/ns16550.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief NS16550 console implementation. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | #if CONFIG_DEVICE_CONSOLE_NS16550 16 | extern const serial_port_ops_t ns16550_serial_port_ops; 17 | #endif 18 | 19 | extern void ns16550_serial_configure(struct kboot_tag_serial *serial, uint32_t clock_rate); 20 | -------------------------------------------------------------------------------- /source/kernel/lib/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'ansi_parser.c', 11 | 'avl_tree.c', 12 | 'bitmap.c', 13 | 'fixed_heap.c', 14 | 'id_allocator.c', 15 | 'notifier.c', 16 | 'printf.c', 17 | 'qsort.c', 18 | 'radix_tree.c', 19 | 'random.c', 20 | 'string.c', 21 | 'tar.c', 22 | ]) 23 | -------------------------------------------------------------------------------- /source/lib/system/dirent/rewinddir.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Rewind directory function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "dirent/dirent.h" 15 | 16 | /** Reset a directory stream's position to the beginning. 17 | * @param dir Directory stream to rewind. */ 18 | void rewinddir(DIR *dir) { 19 | kern_file_rewind_dir(dir->handle); 20 | } 21 | -------------------------------------------------------------------------------- /3rdparty/lib/compiler-rt/lib/builtins/riscv/mulsi3.S: -------------------------------------------------------------------------------- 1 | //===--- mulsi3.S - Integer multiplication routines -----------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #if __riscv_xlen == 32 10 | #define __mulxi3 __mulsi3 11 | #include "int_mul_impl.inc" 12 | #endif 13 | -------------------------------------------------------------------------------- /source/bin/test/test_hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Hello World test application. 9 | */ 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | int main(int argc, char **argv) { 18 | while (true) { 19 | printf("Hello, World!\n"); 20 | kern_thread_sleep(core_secs_to_nsecs(1), NULL); 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/arch/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 stack size definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Stack size definitions. */ 14 | #define KSTACK_SIZE 0x2000 /**< Kernel stack size (8KB). */ 15 | #define USTACK_SIZE 0x200000 /**< User stack size (2MB). */ 16 | 17 | /** Stack direction definition. */ 18 | #define STACK_GROWS_DOWN 1 19 | -------------------------------------------------------------------------------- /source/kernel/arch/arm64/include/arch/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 stack size definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Stack size definitions. */ 14 | #define KSTACK_SIZE 0x2000 /**< Kernel stack size (8KB). */ 15 | #define USTACK_SIZE 0x200000 /**< User stack size (2MB). */ 16 | 17 | /** Stack direction definition. */ 18 | #define STACK_GROWS_DOWN 1 19 | -------------------------------------------------------------------------------- /source/kernel/console/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_env', 'kern_sources') 7 | from util import feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'console.c', 11 | 'fb.c', 12 | 'font.c', 13 | 'logo.c', 14 | ]) 15 | 16 | # Generate the boot splash image files. 17 | kern_env.Command( 18 | 'logo.c', 19 | ['logo.ppm'], 20 | Action('$BIN2HEX $SOURCE logo_ppm > $TARGET', '$GENCOMSTR')) 21 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/nearbyintl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 5 | long double nearbyintl(long double x) 6 | { 7 | return nearbyint(x); 8 | } 9 | #else 10 | #include 11 | long double nearbyintl(long double x) 12 | { 13 | #ifdef FE_INEXACT 14 | #pragma STDC FENV_ACCESS ON 15 | int e; 16 | 17 | e = fetestexcept(FE_INEXACT); 18 | #endif 19 | x = rintl(x); 20 | #ifdef FE_INEXACT 21 | if (!e) 22 | feclearexcept(FE_INEXACT); 23 | #endif 24 | return x; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /source/kernel/io/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_dirs, feature_sources 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'context.c', 11 | 'file.c', 12 | 'file_map.c', 13 | 'fs.c', 14 | 'memory_file.c', 15 | 'pipe.c', 16 | 'request.c', 17 | 'socket.c', 18 | 'user_file.c', 19 | ]) 20 | 21 | SConscript(dirs = feature_dirs(config, [ 22 | 'fs', 23 | ])) 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/hstrerror.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #ifdef __Kiwi__ 4 | // TODO 5 | #define LCTRANS_CUR(s) s 6 | #else 7 | #include "locale_impl.h" 8 | #endif 9 | 10 | static const char msgs[] = 11 | "Host not found\0" 12 | "Try again\0" 13 | "Non-recoverable error\0" 14 | "Address not available\0" 15 | "\0Unknown error"; 16 | 17 | const char *hstrerror(int ecode) 18 | { 19 | const char *s; 20 | for (s=msgs, ecode--; ecode && *s; ecode--, s++) for (; *s; s++); 21 | if (!*s) s++; 22 | return LCTRANS_CUR(s); 23 | } 24 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Kernel log definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Kernel log level definitions. */ 14 | #define LOG_DEBUG 1 /**< Debug message. */ 15 | #define LOG_NOTICE 2 /**< Normal message. */ 16 | #define LOG_WARN 3 /**< Warning message. */ 17 | #define LOG_ERROR 4 /**< Error message. */ 18 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "SCons", 8 | "type": "shell", 9 | "command": "scons PARALLEL=1", 10 | "options": { 11 | "cwd": "${workspaceFolder}" 12 | }, 13 | "group": { 14 | "kind": "build", 15 | "isDefault": true 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/complex/casinl.c: -------------------------------------------------------------------------------- 1 | #include "complex_impl.h" 2 | 3 | #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 | long double complex casinl(long double complex z) 5 | { 6 | return casin(z); 7 | } 8 | #else 9 | // FIXME 10 | long double complex casinl(long double complex z) 11 | { 12 | long double complex w; 13 | long double x, y; 14 | 15 | x = creall(z); 16 | y = cimagl(z); 17 | w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y); 18 | long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w)); 19 | return CMPLXL(cimagl(r), -creall(r)); 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /source/kernel/device/disk/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "Disk devices" 7 | 8 | # Selected by ATA device drivers if enabled. 9 | config DEVICE_DISK_ATA 10 | bool 11 | 12 | config DEVICE_DISK_PCI_ATA 13 | bool "PCI ATA controller driver" 14 | default y 15 | select DEVICE_DISK_ATA 16 | depends on DEVICE_BUS_PCI 17 | help 18 | Enable the PCI ATA controller driver. This supports PATA (IDE) 19 | controllers, and SATA controllers in IDE emulation mode. 20 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/lib/abi/README.TXT: -------------------------------------------------------------------------------- 1 | This directory contains abi lists representing the symbols exported 2 | by the libc++ library. The lists are generated using libcxx/utils/generate_abi_list.py. 3 | 4 | Every time a symbol is added or removed from the libc++ library, each of the 5 | lists *MUST* be updated to reflect the changes. This can be done by using the 6 | `generate-cxx-abilist` CMake target. 7 | 8 | We do not keep an up-to-date ABI list for all the build configurations of libc++. 9 | Currently, only the default configuration on MacOS and Linux are supported. 10 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/include/resolv.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOLV_H 2 | #define RESOLV_H 3 | 4 | #include "../../include/resolv.h" 5 | 6 | hidden int __dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int); 7 | 8 | hidden int __res_mkquery(int, const char *, int, int, const unsigned char *, int, const unsigned char*, unsigned char *, int); 9 | hidden int __res_send(const unsigned char *, int, unsigned char *, int); 10 | hidden int __res_msend(int, const unsigned char *const *, const int *, unsigned char *const *, int *, int); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/lib/system/include/ucontext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief User context definition. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __SYS_EXTERN_C_BEGIN 16 | 17 | /* int getcontext(ucontext_t *); */ 18 | /* int setcontext(const ucontext_t *); */ 19 | /* void makecontext(ucontext_t *, (void *)(), int, ...); */ 20 | /* int swapcontext(ucontext_t *, const ucontext_t *); */ 21 | 22 | __SYS_EXTERN_C_END 23 | -------------------------------------------------------------------------------- /source/services/test/protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Service manager IPC protocol. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Service manager message IDs. */ 14 | enum { 15 | TEST_SIGNAL_START = 0, 16 | TEST_REQUEST_PING = 1, 17 | }; 18 | 19 | #define TEST_STRING_LEN 16 20 | 21 | typedef struct test_request_ping { 22 | uint32_t index; 23 | char string[TEST_STRING_LEN]; 24 | } test_request_ping_t; 25 | -------------------------------------------------------------------------------- /source/kernel/arch/amd64/include/x86/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 console code. 9 | */ 10 | 11 | #pragma once 12 | 13 | /** Keyboard code definitions */ 14 | #define LEFT_CTRL 0x1d 15 | #define RIGHT_CTRL 0x1d 16 | #define LEFT_ALT 0x38 17 | #define RIGHT_ALT 0x38 18 | #define LEFT_SHIFT 0x2a 19 | #define RIGHT_SHIFT 0x36 20 | 21 | extern void i8042_init(void); 22 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/include/__support/solaris/floatingpoint.h: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #define atof sun_atof 10 | #define strtod sun_strtod 11 | #include_next "floatingpoint.h" 12 | #undef atof 13 | #undef strtod 14 | -------------------------------------------------------------------------------- /source/kernel/device/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('config', 'kern_sources') 7 | from util import feature_sources, feature_dirs 8 | 9 | kern_sources += feature_sources(config, [ 10 | 'bus.c', 11 | 'class.c', 12 | 'device.c', 13 | 'dma.c', 14 | 'io.c', 15 | 'irq.c', 16 | ]) 17 | 18 | SConscript(dirs = feature_dirs(config, [ 19 | 'bus', 20 | 'console', 21 | 'disk', 22 | 'irq', 23 | 'input', 24 | 'net', 25 | 'timer', 26 | ])) 27 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/net/unix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief UNIX socket definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** UNIX socket address specification. */ 18 | typedef struct sockaddr_un { 19 | sa_family_t sun_family; 20 | char sun_path[SOCKADDR_STORAGE_SIZE - sizeof(sa_family_t)]; 21 | } sockaddr_un_t; 22 | 23 | __KERNEL_EXTERN_C_END 24 | -------------------------------------------------------------------------------- /source/lib/system/stdio/remove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Path remove function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | /** Remove a path from the filesystem. 15 | * @param path Path to remove. 16 | * @return 0 on success, -1 on failure. */ 17 | int remove(const char *path) { 18 | /* Our unlink implementation supports directory removal. */ 19 | return unlink(path); 20 | } 21 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/format.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "format" 10 | 11 | _LIBCPP_BEGIN_NAMESPACE_STD 12 | 13 | format_error::~format_error() noexcept = default; 14 | 15 | _LIBCPP_END_NAMESPACE_STD 16 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/utility.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "utility" 10 | 11 | _LIBCPP_BEGIN_NAMESPACE_STD 12 | 13 | const piecewise_construct_t piecewise_construct{}; 14 | 15 | _LIBCPP_END_NAMESPACE_STD 16 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ceilf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float ceilf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f; 7 | uint32_t m; 8 | 9 | if (e >= 23) 10 | return x; 11 | if (e >= 0) { 12 | m = 0x007fffff >> e; 13 | if ((u.i & m) == 0) 14 | return x; 15 | FORCE_EVAL(x + 0x1p120f); 16 | if (u.i >> 31 == 0) 17 | u.i += m; 18 | u.i &= ~m; 19 | } else { 20 | FORCE_EVAL(x + 0x1p120f); 21 | if (u.i >> 31) 22 | u.f = -0.0; 23 | else if (u.i << 1) 24 | u.f = 1.0; 25 | } 26 | return u.f; 27 | } 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/floorf.c: -------------------------------------------------------------------------------- 1 | #include "libm.h" 2 | 3 | float floorf(float x) 4 | { 5 | union {float f; uint32_t i;} u = {x}; 6 | int e = (int)(u.i >> 23 & 0xff) - 0x7f; 7 | uint32_t m; 8 | 9 | if (e >= 23) 10 | return x; 11 | if (e >= 0) { 12 | m = 0x007fffff >> e; 13 | if ((u.i & m) == 0) 14 | return x; 15 | FORCE_EVAL(x + 0x1p120f); 16 | if (u.i >> 31) 17 | u.i += m; 18 | u.i &= ~m; 19 | } else { 20 | FORCE_EVAL(x + 0x1p120f); 21 | if (u.i >> 31 == 0) 22 | u.i = 0; 23 | else if (u.i << 1) 24 | u.f = -1.0; 25 | } 26 | return u.f; 27 | } 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ilogbf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int ilogbf(float x) 5 | { 6 | #pragma STDC FENV_ACCESS ON 7 | union {float f; uint32_t i;} u = {x}; 8 | uint32_t i = u.i; 9 | int e = i>>23 & 0xff; 10 | 11 | if (!e) { 12 | i <<= 9; 13 | if (i == 0) { 14 | FORCE_EVAL(0/0.0f); 15 | return FP_ILOGB0; 16 | } 17 | /* subnormal x */ 18 | for (e = -0x7f; i>>31 == 0; e--, i<<=1); 19 | return e; 20 | } 21 | if (e == 0xff) { 22 | FORCE_EVAL(0/0.0f); 23 | return i<<9 ? FP_ILOGBNAN : INT_MAX; 24 | } 25 | return e - 0x7f; 26 | } 27 | -------------------------------------------------------------------------------- /source/bin/posix/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | Import('manager') 7 | 8 | env = manager.create() 9 | 10 | env.KiwiApplication('cat', ['cat.c']) 11 | env.KiwiApplication('cp', ['cp.c']) 12 | env.KiwiApplication('ln', ['ln.c']) 13 | env.KiwiApplication('ls', ['ls.c']) 14 | env.KiwiApplication('mkdir', ['mkdir.c']) 15 | env.KiwiApplication('mv', ['mv.c']) 16 | env.KiwiApplication('rm', ['rm.c']) 17 | env.KiwiApplication('rmdir', ['rmdir.c']) 18 | env.KiwiApplication('unlink', ['unlink.c']) 19 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/math/ilogb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libm.h" 3 | 4 | int ilogb(double x) 5 | { 6 | #pragma STDC FENV_ACCESS ON 7 | union {double f; uint64_t i;} u = {x}; 8 | uint64_t i = u.i; 9 | int e = i>>52 & 0x7ff; 10 | 11 | if (!e) { 12 | i <<= 12; 13 | if (i == 0) { 14 | FORCE_EVAL(0/0.0f); 15 | return FP_ILOGB0; 16 | } 17 | /* subnormal x */ 18 | for (e = -0x3ff; i>>63 == 0; e--, i<<=1); 19 | return e; 20 | } 21 | if (e == 0x7ff) { 22 | FORCE_EVAL(0/0.0f); 23 | return i<<12 ? FP_ILOGBNAN : INT_MAX; 24 | } 25 | return e - 0x3ff; 26 | } 27 | -------------------------------------------------------------------------------- /source/kernel/include/lib/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Formatted output function. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | /** Type for a do_printf() helper function. */ 16 | typedef void (*printf_helper_t)(char, void *, int *); 17 | 18 | extern int do_vprintf(printf_helper_t helper, void *data, const char *fmt, va_list args); 19 | extern int do_printf(printf_helper_t helper, void *data, const char *fmt, ...); 20 | -------------------------------------------------------------------------------- /source/services/terminal_service/terminal_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Terminal service. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | class TerminalService { 16 | public: 17 | TerminalService(); 18 | ~TerminalService(); 19 | 20 | int run(); 21 | 22 | private: 23 | Kiwi::Core::Handle m_port; 24 | size_t m_nextTerminalId; 25 | }; 26 | 27 | extern TerminalService g_terminalService; 28 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/fenv/fenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* Dummy functions for archs lacking fenv implementation */ 4 | 5 | int feclearexcept(int mask) 6 | { 7 | return 0; 8 | } 9 | 10 | int feraiseexcept(int mask) 11 | { 12 | return 0; 13 | } 14 | 15 | int fetestexcept(int mask) 16 | { 17 | return 0; 18 | } 19 | 20 | int fegetround(void) 21 | { 22 | return FE_TONEAREST; 23 | } 24 | 25 | int __fesetround(int r) 26 | { 27 | return 0; 28 | } 29 | 30 | int fegetenv(fenv_t *envp) 31 | { 32 | return 0; 33 | } 34 | 35 | int fesetenv(const fenv_t *envp) 36 | { 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/include/fenv.h: -------------------------------------------------------------------------------- 1 | #ifndef _FENV_H 2 | #define _FENV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | int feclearexcept(int); 11 | int fegetexceptflag(fexcept_t *, int); 12 | int feraiseexcept(int); 13 | int fesetexceptflag(const fexcept_t *, int); 14 | int fetestexcept(int); 15 | 16 | int fegetround(void); 17 | int fesetround(int); 18 | 19 | int fegetenv(fenv_t *); 20 | int feholdexcept(fenv_t *); 21 | int fesetenv(const fenv_t *); 22 | int feupdateenv(const fenv_t *); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /utilities/sysgen/amd64_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief AMD64 system call code generator. 9 | */ 10 | 11 | #ifndef SYSGEN_AMD64_TARGET_H 12 | #define SYSGEN_AMD64_TARGET_H 13 | 14 | #include "sysgen.h" 15 | 16 | /** AMD64 target class. */ 17 | class AMD64Target : public Target { 18 | public: 19 | void add_types(TypeMap &map); 20 | void generate(std::ostream &stream, const SyscallList &calls); 21 | }; 22 | 23 | #endif /* SYSGEN_AMD64_TARGET_H */ 24 | -------------------------------------------------------------------------------- /utilities/sysgen/arm64_target.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief ARM64 system call code generator. 9 | */ 10 | 11 | #ifndef SYSGEN_ARM64_TARGET_H 12 | #define SYSGEN_ARM64_TARGET_H 13 | 14 | #include "sysgen.h" 15 | 16 | /** ARM64 target class. */ 17 | class ARM64Target : public Target { 18 | public: 19 | void add_types(TypeMap &map); 20 | void generate(std::ostream &stream, const SyscallList &calls); 21 | }; 22 | 23 | #endif /* SYSGEN_ARM64_TARGET_H */ 24 | -------------------------------------------------------------------------------- /source/kernel/device/irq/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: (C) Alex Smith 3 | # SPDX-License-Identifier: ISC 4 | # 5 | 6 | comment "IRQ controllers" 7 | 8 | config DEVICE_IRQ_ARM_GIC_V2 9 | bool "ARM GIC v2 IRQ controller" 10 | default y 11 | depends on DEVICE_BUS_DT && ARCH_ARM64 12 | help 13 | Enable the driver for the ARM GIC v2 IRQ controller. 14 | 15 | config DEVICE_IRQ_BCM2836_L1 16 | bool "BCM2836 L1 IRQ controller" 17 | default y 18 | depends on DEVICE_BUS_DT && ARCH_ARM64 19 | help 20 | Enable the driver for the root IRQ controller on the Raspberry Pi 2+. 21 | -------------------------------------------------------------------------------- /source/kernel/include/proc/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Thread scheduler. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | extern void sched_reschedule(bool state); 16 | extern void sched_post_switch(bool state); 17 | extern void sched_preempt(void); 18 | extern void sched_insert_thread(thread_t *thread); 19 | 20 | extern void sched_init(void); 21 | extern void sched_init_percpu(void); 22 | extern void sched_enter(void) __noreturn; 23 | -------------------------------------------------------------------------------- /3rdparty/lib/libcxx/src/variant.cpp: -------------------------------------------------------------------------------- 1 | //===----------------------------------------------------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | 9 | #include "variant" 10 | 11 | namespace std { 12 | 13 | const char* bad_variant_access::what() const noexcept { 14 | return "bad_variant_access"; 15 | } 16 | 17 | } // namespace std 18 | -------------------------------------------------------------------------------- /source/lib/system/stdio/fclose.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief File close function. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "stdio/stdio.h" 15 | 16 | /** Close a file stream. 17 | * @param stream File stream to close. 18 | * @return 0 on success, EOF on failure. */ 19 | int fclose(FILE *stream) { 20 | if (close(stream->fd) != 0) 21 | return EOF; 22 | 23 | free(stream); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/device/bus/virtio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief VirtIO bus interface. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** VirtIO device class name. */ 18 | #define VIRTIO_DEVICE_CLASS_NAME "virtio_device" 19 | 20 | /** VirtIO device class attribute names. */ 21 | #define VIRTIO_DEVICE_ATTR_DEVICE_ID "virtio_device.device_id" /**< uint16 */ 22 | 23 | __KERNEL_EXTERN_C_END 24 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/internal/complex_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMPLEX_IMPL_H 2 | #define _COMPLEX_IMPL_H 3 | 4 | #include 5 | #include "libm.h" 6 | 7 | #undef __CMPLX 8 | #undef CMPLX 9 | #undef CMPLXF 10 | #undef CMPLXL 11 | 12 | #define __CMPLX(x, y, t) \ 13 | ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z) 14 | 15 | #define CMPLX(x, y) __CMPLX(x, y, double) 16 | #define CMPLXF(x, y) __CMPLX(x, y, float) 17 | #define CMPLXL(x, y) __CMPLX(x, y, long double) 18 | 19 | hidden double complex __ldexp_cexp(double complex,int); 20 | hidden float complex __ldexp_cexpf(float complex,int); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /3rdparty/lib/musl/src/network/gethostbyname2.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct hostent *gethostbyname2(const char *name, int af) 9 | { 10 | static struct hostent *h; 11 | size_t size = 63; 12 | struct hostent *res; 13 | int err; 14 | do { 15 | free(h); 16 | h = malloc(size+=size+1); 17 | if (!h) { 18 | h_errno = NO_RECOVERY; 19 | return 0; 20 | } 21 | err = gethostbyname2_r(name, af, h, 22 | (void *)(h+1), size-sizeof *h, &res, &h_errno); 23 | } while (err == ERANGE); 24 | return err ? 0 : h; 25 | } 26 | -------------------------------------------------------------------------------- /source/kernel/include/kernel/exit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: (C) Alex Smith 3 | * SPDX-License-Identifier: ISC 4 | */ 5 | 6 | /** 7 | * @file 8 | * @brief Process/thread exit code definitions. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | __KERNEL_EXTERN_C_BEGIN 16 | 17 | /** Process/thread exit reasons. */ 18 | #define EXIT_REASON_NORMAL 0 /**< Normal exit. */ 19 | #define EXIT_REASON_KILLED 1 /**< Process/thread was killed. */ 20 | #define EXIT_REASON_EXCEPTION 2 /**< Unhandled exception. */ 21 | 22 | __KERNEL_EXTERN_C_END 23 | --------------------------------------------------------------------------------