Git Product home page Git Product logo

lemonos's Introduction

banner

CI

Lemon OS is a UNIX-like 64-bit operating system written in C++.

About Lemon OS

Lemon OS includes its own modular kernel with SMP and networking, window server/compositor and userspace applications as well as a collection of software ports.

If you have any questions or concerns feel free to open a GitHub issue, join our Discord server or email me at [email protected].

Prebuilt Image

Nightly Images

Before running See System Requirements

Lemon OS Screenshot
More screenshots

Features

Work In Progress

  • XHCI Driver
  • Intel HD Audio Driver

Third Party

Lemon OS depends on: mlibc, Freetype, zlib, libressl, ffmpeg, libfmt, libjpeg-turbo and libpng.

Optional ports include LLVM/Clang, DOOM, Binutils and Python 3.8

Various background images are located here

System requirements

  • 256 MB RAM (512 is more optimal)
  • x86_64 Processor supporting x86_64-v2 instructions including SSE4.2
    • For QEMU/KVM use -cpu host or at least -cpu Nehalem see this page
  • 2 or more CPU cores recommended
  • I/O APIC
  • ATA, NVMe or AHCI disk (AHCI strongly recommended)

For QEMU run with:
qemu-system-x86_64 Lemon.img --enable-kvm -cpu host -M q35 -smp 2 -m 1G -netdev user,id=net0 -device e1000,netdev=net0 -device ac97
KVM is strongly recommended

Repo Structure

Directory Description
Applications/ Userspace Applications
Base/ Config, etc. Files copied to disk
Documentation/ Lemon OS Documentation
Extra/ (Currently) vector icons
InterfaceCompiler/ Compiler for interface definition files
Kernel/ Lemon Kernel
LibGUI/ LibGUI (Windowing and widgets)
LibLemon/ LibLemon (Lemon API)
Toolchain/ Toolchain build scripts and patches
Ports/ Build scripts and patches for ports
Resources/ Images, fonts, etc.
Screenshots/ Screenshots
Scripts/ Build Scripts
Services/ Interface definition files
System/ Core system programs and services

lemonos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lemonos's Issues

lemon-clang++ cannot build mlibc

In either docker or non docker I run into this same error when following the build instructions:

In file included from ../options/ansi/generic/stdio-stubs.cpp:15:
In file included from ../options/internal/include/mlibc/allocator.hpp:6:
In file included from ../subprojects/frigg/include/frg/slab.hpp:7:
In file included from ../subprojects/frigg/include/frg/mutex.hpp:4:
In file included from ../subprojects/cxxshim/stage2/include/utility:5:
../subprojects/cxxshim/stage2/include/type_traits:217:2: error: unknown type name 'concept'
        concept is_invokable_with = requires (F f, Args ...args) {
        ^
../subprojects/cxxshim/stage2/include/type_traits:217:40: error: 'F' does not refer to a value
        concept is_invokable_with = requires (F f, Args ...args) {
                                              ^
../subprojects/cxxshim/stage2/include/type_traits:216:21: note: declared here
        template <typename F, typename... Args>
                           ^
../subprojects/cxxshim/stage2/include/type_traits:217:45: error: 'Args' does not refer to a value
        concept is_invokable_with = requires (F f, Args ...args) {
                                                   ^
../subprojects/cxxshim/stage2/include/type_traits:216:36: note: declared here
        template <typename F, typename... Args>
                                          ^

Not sure what to do about this, but is there something I am missing? I just ran the docker configure script and that's it.

GPF on VMWare 16

Hey, first of all, great work on the OS!
Just wanted to try it out because it looked pretty nice on the screenshots. Tried running it on VMWare 16 Pro and it GPFs on every boot, here's a screenshot:
image

I used mostly default settings:
image

git clone fail

git clone https://github.com/fido2020/Lemon-OS.git --recurse-submodules
......
Submodule path 'Applications/subprojects/LemonUtils': checked out '1b118e0e14b9ee3ce3e5fa3b7294450132aac7b2'
fatal: remote error: upload-pack: not our ref 06aedffc30dc97279306246a8f284876bde67371
fatal: The remote end hung up unexpectedly
Fetched in submodule path 'LibC', but it did not contain 06aedffc30dc97279306246a8f284876bde67371. Direct fetching of that commit failed.

Intel 82545em

Hello, I encountered such a problem when I was learning the operating system. Intel 82545em driver can normally send packets in VirtualBox, but not in VMware. I used Wireshark for testing. Can I ask if the Intel 82545em driver of lemonos can work normally in VMware?

Reclaimable memory for cache

The filesystem block cache should be reclaimed when memory is low and hence should not count towards used memory

Information...

I want to add the Wi-Fi connection function and the web browser application to my own operating system. but I can't find the Wi-Fi connection function information on the "wiki.osdev" site, so I'd like to know where you got the related data.

Executing libc++.so through the Run application causes a page fault

Using run to execute /lib/libc++.so causes the kernel to panic. For some reason, Lemon holds the SHIFT key permanently after pressing SHIFT + =, so that's another bug to fix as well!

Steps to Reproduce

  • Open Run.
  • Type /lib/libc++ into the dialog box.
  • Press LSHIFT + TAB to stop Lemon from holding SHIFT.
  • Type .so to finish the path.
  • Press Enter.

Screenshot

Kernel panic screenshot.

Serial Output

Windows Hypervisor Platform accelerator is operational

[INFO]    Initializing Lemon...

[INFO]    Initializing System Timer...OK
[INFO]    Initializing ACPI...OK
[INFO]    Initializing PCI...OK
[INFO]    Initializing Local and I/O APIC...OK
[INFO]    Initializing SMP...
[INFO]    [SMP] 2 processors initialized!OK
[INFO]    Used RAM: 1 MB
[INFO]    Initializing Ramdisk...OK
[INFO]    Initializing HID...
[INFO]    OK
[INFO]    Initializing Task Scheduler...
[ERROR]   [PCIDevice] AllocateVector: Device not MSI capable!
[INFO]    [XHCI] Interface version: 0x0, Page size: 1, Operational registers offset: 0x40, Runtime registers offset: 0x1
000, Doorbell registers offset: 0x2000
[WARN]    [ATA] No IDE controller found!
[INFO]    Initializing AHCI Controller...
[WARN]    [SATA] Port Hung
[INFO]    [AHCI] Found 3 partitions!
[INFO]    [Ext2] Initializing Volume    Revision: 1, Block Size: 4096, 791108 KB/914432 KB used, Last mounted on: /mnt/L
emon
[INFO]    [FAT32] Initializing Volume   Signature: 41, OEM ID: mkfs.fat, Size: 128 MB
[INFO]    [i8254x]    Base Address: 0xfebc0000, Base Address (virtual): 0xffffffff7ebc0000, IO Base: 0xc000, EEPROM Pres
ent: true, Base Address 1: 0xc000, Base Address 2: 0x0
[ERROR]   [PCIDevice] AllocateVector: Device not MSI capable!,IRQ: 0x2b
[INFO]    [i8254x] MAC Address: 0xde:0xad:0x69:0xbe:0xef:0x42
[INFO]    [i8254x] Link Up, Speed: 1000
[INFO]    [Network] Initializing network interface layer...
[INFO]    Loading Init Process...OK
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4527880
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4526904
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4525928
[INFO]    (Init): mlibc: Broken mbtowc() called, 4528320
[INFO]    Loading: /system/lemon/lemonwm.lef
[INFO]    Done (took 414000 us)
[INFO]    Loading: /system/bin/shell.lef
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4662904
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4661928
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4660952
[INFO]    (lemonwm.lef): mlibc: Broken mbtowc() called, 4663344
[INFO]    Done (took 1482000 us)
[INFO]    Loading: /system/lemon/netgov.lef
[INFO]    (shell.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4900472
[INFO]    (shell.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4899496
[INFO]    (shell.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4898520
[INFO]    (shell.lef): mlibc: Broken mbtowc() called, 4900912
[INFO]    Done (took 112000 us)[LemonWM] Creating Window:    Pos: (0, 1044), Size: 1920x36, Title:
[LemonWM] Creating Window:    Pos: (0, 0), Size: 36x1044, Title:

[INFO]    Process Init (PID: 5) exiting with code 0
[INFO]    (netgov.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4466296
[INFO]    (netgov.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4465320
[INFO]    (netgov.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4464344
[INFO]    (netgov.lef): mlibc: Broken mbtowc() called, 4466736
[WARN]    SysKernelObjectDestroy: Invalid handle ID 0
[WARN]    SysExitThread is unimplemented! Hanging!Initializing interface e1k0s3!
received dhcp response:
IP Address: 10.0.2.15
Subnet Mask: 255.255.255.0
Default Gateway: 10.0.2.2
DNS Server: 10.0.2.3

[INFO]    Process netgov.lef (PID: 8) exiting with code 0[LemonWM] Creating Window:    Pos: (44, 154), Size: 42x20, Titl
e:

[WARN]    SysExitThread is unimplemented! Hanging!
[INFO]    Loading: /system/bin/fileman.lef
[INFO]    Done (took 514000 us)
[INFO]    (fileman.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4802184
[INFO]    (fileman.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4801208
[INFO]    (fileman.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4800232
[INFO]    (fileman.lef): mlibc: Broken mbtowc() called, 4802624[LemonWM] Creating Window:    Pos: (20, 20), Size: 600x34
8, Title: Fileman

[INFO]    Loading: /system/bin/run.lef
[INFO]    Done (took 533000 us)
[INFO]    (run.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4793992
[INFO]    (run.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4793016
[INFO]    (run.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4792040
[INFO]    (run.lef): mlibc: Broken mbtowc() called, 4794432[LemonWM] Creating Window:    Pos: (20, 20), Size: 200x78, Ti
tle: Run...

[INFO]    Loading: /lib/libc++.so
[INFO]    Done (took 0 us)
[WARN]    Invalid ELF Header: 0x4e, 0x50, 0x55 (NPU)Page Fault

[INFO]    Page not present
[INFO]    Read Only
[INFO]    RIP:
[INFO]    0xffffffff80110267
[INFO]    Process: run.lef (10)
[INFO]
Fault address:
[INFO]    0x10c0
[INFO]    Register Dump: a: 0x10c0, b:0x0, c:0x0, d:0x6c, S:0x6c, D:0x10c0, sp:0xffffffffc53b0c88, bp:0xffffffffc53b0cb0
[INFO]    0xffffffff80148132
[INFO]    0xffffffff80151dc6
[INFO]    0xffffffff80106b0aPage Fault

[INFO]    Page not present
[INFO]    RIP:
[INFO]    0xffffffff801102ac
[INFO]    Process: run.lef (10)
[INFO]
Fault address:
[INFO]    0xffffff0030633031
[INFO]    Register Dump: a: 0xffffff0030633031, b:0x0, c:0x0, d:0x3c0, S:0xffffffff80110290, D:0xffffff0030633031, sp:0x
ffffffffc53b0850, bp:0xffffffffc53b0860
[INFO]    0xffffffff8010e96b
[INFO]    0xffffffff8013f7cc
[INFO]    0xffffffff8013da79
[INFO]    0xffffffff801065d4
[ERROR]   Fatal Kernel Exception:
[INFO]    0xd
[INFO]    RIP:
[INFO]    0xffffffff801102ac
[INFO]    Error Code:
[INFO]    0x0
[INFO]    Register Dump: a: 0x3030666666666666, b:0x0, c:0x0, d:0x3c0, S:0xffffffff80110290, D:0x3030666666666666, sp:0x
ffffffffc53b0420, bp:0xffffffffc53b0430
[INFO]    Stack Trace:
[INFO]    0xffffffff8010e96b
[INFO]    0xffffffff8013f7cc
[INFO]    0xffffffff8013da79
[INFO]    0xffffffff801065d4

lemon-clang++ crashes while building

While I was running ninja install inside the Build directory, lemon-clang++ crashed:

[24/243] Generating 'Kernel/kernel.sys.p/SMPTrampoline.bin.o'.
test
[132/243] Compiling C++ object Kernel/kernel.sys.p/src_Objects_Process.cpp.o
FAILED: Kernel/kernel.sys.p/src_Objects_Process.cpp.o
/home/kai/.local/share/lemon/bin/lemon-clang++ -IKernel/kernel.sys.p -IKernel/ -I../Kernel -I../Kernel/include -I../Kernel/include/Arch/x86_64 -I../subprojects/lai/include -I../subprojects/frigg/include -I../subprojects/cxxshim/stage2/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++2a -g -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16 -msahf -Wno-write-strings -Wno-unused-parameter -Wno-sign-compare -DLemon64 -ffreestanding -nostdlib -mcmodel=large -mno-red-zone -fno-pic -mno-mmx -mno-sse -mno-sse2 -fno-stack-protector -fno-builtin -finline-functions -fno-exceptions -fno-rtti -Wno-deprecated-volatile -Wno-non-c-typedef-for-linkage -MD -MQ Kernel/kernel.sys.p/src_Objects_Process.cpp.o -MF Kernel/kernel.sys.p/src_Objects_Process.cpp.o.d -o Kernel/kernel.sys.p/src_Objects_Process.cpp.o -c ../Kernel/src/Objects/Process.cpp
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/kai/.local/share/lemon/bin/lemon-clang++ -IKernel/kernel.sys.p -IKernel/ -I../Kernel -I../Kernel/include -I../Kernel/include/Arch/x86_64 -I../subprojects/lai/include -I../subprojects/frigg/include -I../subprojects/cxxshim/stage2/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++2a -g -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16 -msahf -Wno-write-strings -Wno-unused-parameter -Wno-sign-compare -DLemon64 -ffreestanding -nostdlib -mcmodel=large -mno-red-zone -fno-pic -mno-mmx -mno-sse -mno-sse2 -fno-stack-protector -fno-builtin -finline-functions -fno-exceptions -fno-rtti -Wno-deprecated-volatile -Wno-non-c-typedef-for-linkage -MD -MQ Kernel/kernel.sys.p/src_Objects_Process.cpp.o -MF Kernel/kernel.sys.p/src_Objects_Process.cpp.o.d -o Kernel/kernel.sys.p/src_Objects_Process.cpp.o -c ../Kernel/src/Objects/Process.cpp
1.	<eof> parser at end of file
2.	Code generation
 #0 0x000056305d8270c4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000056305d8250fc llvm::sys::CleanupOnSignal(unsigned long) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x1a590fc)
 #2 0x000056305d795328 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007fbedddb51f0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x141f0)
 #4 0x000056305e3a6747 llvm::DIE::getUnitDie() const (/home/kai/.local/share/lemon/bin/lemon-clang+++0x25da747)
 #5 0x000056305e3b3824 llvm::DwarfDebug::finishEntityDefinitions() (/home/kai/.local/share/lemon/bin/lemon-clang+++0x25e7824)
 #6 0x000056305e3c5c19 llvm::DwarfDebug::finalizeModuleInfo() (/home/kai/.local/share/lemon/bin/lemon-clang+++0x25f9c19)
 #7 0x000056305e3ca7d8 llvm::DwarfDebug::endModule() (/home/kai/.local/share/lemon/bin/lemon-clang+++0x25fe7d8)
 #8 0x000056305e39e1fb llvm::AsmPrinter::doFinalization(llvm::Module&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x25d21fb)
 #9 0x000056305d135b25 llvm::FPPassManager::doFinalization(llvm::Module&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x1369b25)
#10 0x000056305d142228 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x1376228)
#11 0x000056305dafb343 (anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (.constprop.0) BackendUtil.cpp:0:0
#12 0x000056305daffa57 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x1d33a57)
#13 0x000056305e777e82 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x29abe82)
#14 0x000056305f2bb9e9 clang::ParseAST(clang::Sema&, bool, bool) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x34ef9e9)
#15 0x000056305e19fe79 clang::FrontendAction::Execute() (/home/kai/.local/share/lemon/bin/lemon-clang+++0x23d3e79)
#16 0x000056305e133db9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x2367db9)
#17 0x000056305e24dcd8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x2481cd8)
#18 0x000056305c669b40 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x89db40)
#19 0x000056305c66727d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#20 0x000056305dfc7249 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#21 0x000056305d795437 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x19c9437)
#22 0x000056305dfc75bc clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.0) Job.cpp:0:0
#23 0x000056305df9c3bb clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/kai/.local/share/lemon/bin/lemon-clang+++0x21d03bb)
#24 0x000056305df9cdc9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/home/kai/.local/share/lemon/bin/lemon-clang+++0x21d0dc9)
#25 0x000056305dfab4a1 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/home/kai/.local/share/lemon/bin/lemon-clang+++0x21df4a1)
#26 0x000056305c5ea10d main (/home/kai/.local/share/lemon/bin/lemon-clang+++0x81e10d)
#27 0x00007fbedd807565 __libc_start_main ./csu/../csu/libc-start.c:332:16
#28 0x000056305c666bfe _start (/home/kai/.local/share/lemon/bin/lemon-clang+++0x89abfe)
clang-13: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Lemon clang version 13.0.0 (https://github.com/LemonOSProject/llvm-project.git 841704471e60b2d2a8a56c2050abd3047a1a21be)
Target: x86_64-unknown-lemon
Thread model: posix
InstalledDir: /home/kai/.local/share/lemon/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/Process-73debd.cpp
clang-13: note: diagnostic msg: /tmp/Process-73debd.sh
clang-13: note: diagnostic msg:

********************
[157/243] Compiling C++ object LibLemon/liblemon.a.p/src_json.cpp.o
ninja: build stopped: subcommand failed.

Here are the files it said to attach: Process-73debd.cpp, Process-73debd.sh

Build instructions

Hello,
This is a great project! Probably one of the best hobby OSes out there. I was wondering how you build this OS.
Thanks a lot.

Init error on real hardware

When attempting to boot the latest build of Lemon OS on a real hardware (an HP Elitebook 8460p), I get an error message saying
Failed to load either init task (init.lef) or fterm (fterm.lef)

I tried booting it in debug mode, log output looks something like this:

[ERROR]    [Ext2] Disk Error Initializing Volume
[ERROR]    fs::VolumeManager::Mount: Unknown driver error mounting volume!
[INFO]     Loading Init Process...

I used BalenaEtcher to flash the boot image to a pendrive

Garbled executable names in log

After building, I ran make run, and opened a terminal and ran a few commands. Initially, the log looks correct. but processes opened from the terminal have their names mangled.

[snip]
[INFO]    Loading: /system/bin/terminal.lef
[INFO]    Done (took 440625 us)
[INFO]    (terminal.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4814472
[INFO]    (terminal.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4813496
[INFO]    (terminal.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4812520
[INFO]    (terminal.lef): mlibc: Broken mbtowc() called, 4814912[LemonWM] Creating Window:    Pos: (20, 20), Size: 720x512, Title: Terminal

[INFO]    Loading: /system/bin/lsh.lef
[INFO]    Done (took 103750 us)
[INFO]    (h� �����): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4503144
[INFO]    (h� �����): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4502168
[INFO]    (h� �����): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4501192
[INFO]    (h� �����): mlibc: Broken mbtowc() called, 4503584
[INFO]    (h� �����): mlibc warning: sys_tcsetattr ignores optional_action, 4504832
[INFO]    (h� �����): mlibc warning: sys_tcsetattr ignores optional_action, 4504832
[INFO]    Loading: /initrd/ls.lef
[INFO]    Done (took 0 us)
[INFO]    (ls): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4466280
[INFO]    (ls): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4465304
[INFO]    (ls): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4464328
[INFO]    (ls): mlibc: Broken mbtowc() called, 4466720
[INFO]    Process ls (PID: 10) exiting with code 0
[snip]

Rapid mouse movement during boot causes page fault

When booting Lemon on QEMU, making rapid mouse movements while the background is loading will cause the kernel to panic. My guess is something to do with writing outside of video memory, but who knows ¯\_(ツ)_/¯ The bug only seems to occur while the background is loading. Once the background loads, I can't reproduce the bug.

Steps to Reproduce

  • Set your mouse to an extremely high DPI (something like 16,000 should do).
  • Start QEMU using the arguments below and pick Lemon OS (1280x720).
  • Move the mouse around rapidly until the kernel panics.

QEMU Arguments

qemu-system-x86_64 lemon.img -no-reboot -no-shutdown -m 1024M -device qemu-xhci -M q35,accel=whpx -smp 2 -serial stdio -netdev user,id=net0 -device e1000,netdev=net0,mac=DE:AD:69:BE:EF:42

Screenshot

Kernel panic screenshot.

Serial Output

Windows Hypervisor Platform accelerator is operational

[INFO]    Initializing Lemon...

[INFO]    Initializing System Timer...OK
[INFO]    Initializing ACPI...OK
[INFO]    Initializing PCI...OK
[INFO]    Initializing Local and I/O APIC...OK
[INFO]    Initializing SMP...
[INFO]    [SMP] 2 processors initialized!OK
[INFO]    Used RAM: 1 MB
[INFO]    Initializing Ramdisk...OK
[INFO]    Initializing HID...
[INFO]    OK
[INFO]    Initializing Task Scheduler...
[ERROR]   [PCIDevice] AllocateVector: Device not MSI capable!
[INFO]    [XHCI] Interface version: 0x0, Page size: 1, Operational registers offset: 0x40, Runtime registers offset: 0x1
000, Doorbell registers offset: 0x2000
[WARN]    [ATA] No IDE controller found!
[INFO]    Initializing AHCI Controller...
[WARN]    [SATA] Port Hung
[INFO]    [AHCI] Found 3 partitions!
[INFO]    [Ext2] Initializing Volume    Revision: 1, Block Size: 4096, 791108 KB/914432 KB used, Last mounted on: /mnt/L
emon
[INFO]    [FAT32] Initializing Volume   Signature: 41, OEM ID: mkfs.fat, Size: 128 MB
[INFO]    [i8254x]    Base Address: 0xfebc0000, Base Address (virtual): 0xffffffff7ebc0000, IO Base: 0xc000, EEPROM Pres
ent: true, Base Address 1: 0xc000, Base Address 2: 0x0
[ERROR]   [PCIDevice] AllocateVector: Device not MSI capable!,IRQ: 0x2b
[INFO]    [i8254x] MAC Address: 0xde:0xad:0x69:0xbe:0xef:0x42
[INFO]    [i8254x] Link Up, Speed: 1000
[INFO]    [Network] Initializing network interface layer...
[INFO]    Loading Init Process...OK
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4527880
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4526904
[INFO]    (Init): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4525928
[INFO]    (Init): mlibc: Broken mbtowc() called, 4528320
[INFO]    Loading: /system/lemon/lemonwm.lef
[INFO]    Done (took 385000 us)
[INFO]    Loading: /system/bin/shell.lef
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4662904
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4661928
[INFO]    (lemonwm.lef): rtdl: DT_FLAGS_1(8) is not implemented correctly!, 4660952
[INFO]    (lemonwm.lef): mlibc: Broken mbtowc() called, 4663344
[INFO]    Done (took 1052000 us)
[INFO]    Loading: /system/lemon/netgov.lef
[INFO]    Done (took 0 us)
[WARN]    Invalid ELF Header: 0x3f, 0x0, 0xfffffffd (?²)Page Fault

[INFO]    Page not present
[INFO]    Read Only
[INFO]    RIP:
[INFO]    0xffffffff80110267
[INFO]    Process: Init (5)
[INFO]
Fault address:
[INFO]    0x10c0
0INFO]    Register Dump: a: 0x10c0, b:0x83ff40, c:0x
,[I NdFO:0] x 6e ,  (Ssh:el0l.xle6fe):, [3:1m0rxtd1l0: cD0T,_F sLApGS:_01(xfff8ff) fisff cno2tc iam8plcem7e8nt,ed  bcopr
:re0ctxlfyf!f[3f9fm,f f4c90204c7a28ca0
[INFO]    0xffffffff80148132
[INFO]    0xffffffff80151dc6
[INFO]    0xffffffff80106b0aPage Fault

[INFO]    Page not present
[INFO]    RIP:
[INFO]    0xffffffff801102ac
[INFO]    Process: Init (5)
[INFO]
Fault address:
[INFO]    0xffffff0030633031
[INFO]    Register Dump: a: 0xffffff0030633031, b:0x83ff40, c:0x0, d:0x280, S:0xffffffff80110290, D:0xffffff0030633031,
sp:0xffffffffc2ca8840, bp:0xffffffffc2ca8850
[INFO]    0xffffffff8010e96b
[INFO]    0xffffffff8013f7cc
[INFO]    0xffffffff8013da79
[INFO]    0xffffffff801065d4
[ERROR]   Fatal Kernel Exception:
[INFO]    0xd
[INFO]    RIP:
[INFO]    0xffffffff801102ac
[INFO]    Error Code:
[INFO]    0x0
[INFO]    Register Dump: a: 0x3030666666666666, b:0x83ff40, c:0x0, d:0x280, S:0xffffffff80110290, D:0x3030666666666666,
sp:0xffffffffc2ca8410, bp:0xffffffffc2ca8420
[INFO]    Stack Trace:
[INFO]    0xffffffff8010e96b
[INFO]    0xffffffff8013f7cc
[INFO]    0xffffffff8013da79
[INFO]    0xffffffff801065d4

GCC Build Fail

./buildtoolchain.sh build

LEMON_SYSROOT or TOOLCHAIN_PREFIX not set, continuing will use defaults:\nTOOLCHAIN_PREFIX: /root/.local/share/lemon\nLEMON_SYSROOT: /root/.local/share/lemon/sysroot
.......

Build proceeds. but last result is
cp: '/root/.local/share/lemon/x86_64-lemon/lib/libgcc_s.so' There are no such files or directories

but i can confirm libgcc_s.so file generated.

can you resolve this?

Is PTYDevice::Ioctl() a possible security/stability problem?

Hi. I'm not actually a LemonOS user. I'm just cruising around reading OS code and I like a lot of what I see in LemonOS - congrats. While I'm thus not a LemonOS dev, I have lots of experience in UNIX-like kernels. Sometimes that's helpful and sometimes it can lead me astray. :-)

There is one bit of code that catches my eye as potentially problematic. It's possible there's something in place elsewhere to prevent this, but it looks like the arg in PTYDevice::Ioctl() is treated as a kernel mode pointer by all five subcommands. I suspect that an evil caller of these, especially from user space, could use these to (slowly) read and write arbitrary kernel memory. If so, I'm sure you recognize that as a Bad Thing.

In a traditional UNIX system, there's a possibility that the pointers could be to user space that's paged out or in another process or in kernel space(!). We'd protect against that via copyin() and copyout()() and testing for errors. I think the LemonOS spelling of that is approximately:
if(!Memory::CheckUsermodePointer(arg, sizeof(THING), currentProcess->addressSpace)){
return -EFAULT;
}

Even if arbitrary read/writes aren't possible (I can't tell if tios and wSz are exposed to user space) it does seem like just casting a pointer received from user space may result in crashes, especially if your OS isn't totally identity mapped with kernel and user addresses mapped the same. (And if they are, you probably have bigger security issues.)

Additionally, are there atomicity issues where termios or wsz in the base class can be partially updated by another process while we get put on the run queue and do these ioctls and get part of an old copy and part of a new copy because no lock is (visibly) held here? Maybe a lock is held externally at some higher external layer that I just don't see looking at pty.[cc,h] in isolation.

I could be wrong and this might all be totally safe. If I am wrong, you don't need to write a dissertation to educate me, but please at least look at that code and pencil-whip it to be sure it's sensible. (I know all too well that in large, complicated products - open and otherwise - sometimes error checking falls on the floor and we assume our callers aren't hostile. It happens.)

Cool project! Thanx for creating code that's easy to read, has a sane mix of C and C++, and no more asm() than it has to be.

Please enable discussion

I've been following development of this project this beginning. And I really love this project. I commented on YouTube sometimes. But enabling discussing would be great. As this project is getting cooler day by day.

'bootstrap.link' File Not Found

Hi, I have a problem after Docker Set up following Build Lemon OS document. When I want to build and run xbstrap install --all in docker container, error happens like this FileNotFoundError: [Errno 2] No such file or directory: 'bootstrap.link'. I'm new to Operating System, so pretty much thanks for checking my issue

lemon-clang: not found

Hello

Environment:
Ubuntu 20.04.2 LTS
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
meson 0.58.1

Command sequence:

cd Toolchain
JOBCOUNT=12 LINKCOUNT=4 ./buildtoolchain.sh build
cd ..
cd Scripts
./configure.sh
cd ..
cd Build
ninja install

Result:

~/LemonOS/Build$ ninja install
[1/226] Compiling C object subprojects/lai/liblai.a.p/core_error.c.o
FAILED: subprojects/lai/liblai.a.p/core_error.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_error.c.o -MF subprojects/lai/liblai.a.p/core_error.c.o.d -o subprojects/lai/liblai.a.p/core_error.c.o -c ../subprojects/lai/core/error.c
/bin/sh: 1: lemon-clang: not found
[2/226] Compiling C object subprojects/lai/liblai.a.p/core_eval.c.o
FAILED: subprojects/lai/liblai.a.p/core_eval.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_eval.c.o -MF subprojects/lai/liblai.a.p/core_eval.c.o.d -o subprojects/lai/liblai.a.p/core_eval.c.o -c ../subprojects/lai/core/eval.c
/bin/sh: 1: lemon-clang: not found
[3/226] Compiling C object subprojects/lai/liblai.a.p/core_exec.c.o
FAILED: subprojects/lai/liblai.a.p/core_exec.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_exec.c.o -MF subprojects/lai/liblai.a.p/core_exec.c.o.d -o subprojects/lai/liblai.a.p/core_exec.c.o -c ../subprojects/lai/core/exec.c
/bin/sh: 1: lemon-clang: not found
[4/226] Compiling C object subprojects/lai/liblai.a.p/core_exec-operand.c.o
FAILED: subprojects/lai/liblai.a.p/core_exec-operand.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_exec-operand.c.o -MF subprojects/lai/liblai.a.p/core_exec-operand.c.o.d -o subprojects/lai/liblai.a.p/core_exec-operand.c.o -c ../subprojects/lai/core/exec-operand.c
/bin/sh: 1: lemon-clang: not found
[5/226] Compiling C object subprojects/lai/liblai.a.p/core_libc.c.o
FAILED: subprojects/lai/liblai.a.p/core_libc.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_libc.c.o -MF subprojects/lai/liblai.a.p/core_libc.c.o.d -o subprojects/lai/liblai.a.p/core_libc.c.o -c ../subprojects/lai/core/libc.c
/bin/sh: 1: lemon-clang: not found
[6/226] Compiling C object subprojects/lai/liblai.a.p/core_ns.c.o
FAILED: subprojects/lai/liblai.a.p/core_ns.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_ns.c.o -MF subprojects/lai/liblai.a.p/core_ns.c.o.d -o subprojects/lai/liblai.a.p/core_ns.c.o -c ../subprojects/lai/core/ns.c
/bin/sh: 1: lemon-clang: not found
[7/226] Compiling C object subprojects/lai/liblai.a.p/core_object.c.o
FAILED: subprojects/lai/liblai.a.p/core_object.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_object.c.o -MF subprojects/lai/liblai.a.p/core_object.c.o.d -o subprojects/lai/liblai.a.p/core_object.c.o -c ../subprojects/lai/core/object.c
/bin/sh: 1: lemon-clang: not found
[8/226] Compiling C object subprojects/lai/liblai.a.p/core_opregion.c.o
FAILED: subprojects/lai/liblai.a.p/core_opregion.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_opregion.c.o -MF subprojects/lai/liblai.a.p/core_opregion.c.o.d -o subprojects/lai/liblai.a.p/core_opregion.c.o -c ../subprojects/lai/core/opregion.c
/bin/sh: 1: lemon-clang: not found
[9/226] Compiling C object subprojects/lai/liblai.a.p/core_os_methods.c.o
FAILED: subprojects/lai/liblai.a.p/core_os_methods.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_os_methods.c.o -MF subprojects/lai/liblai.a.p/core_os_methods.c.o.d -o subprojects/lai/liblai.a.p/core_os_methods.c.o -c ../subprojects/lai/core/os_methods.c
/bin/sh: 1: lemon-clang: not found
[10/226] Compiling C object subprojects/lai/liblai.a.p/core_variable.c.o
FAILED: subprojects/lai/liblai.a.p/core_variable.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_variable.c.o -MF subprojects/lai/liblai.a.p/core_variable.c.o.d -o subprojects/lai/liblai.a.p/core_variable.c.o -c ../subprojects/lai/core/variable.c
/bin/sh: 1: lemon-clang: not found
[11/226] Compiling C object subprojects/lai/liblai.a.p/core_vsnprintf.c.o
FAILED: subprojects/lai/liblai.a.p/core_vsnprintf.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/core_vsnprintf.c.o -MF subprojects/lai/liblai.a.p/core_vsnprintf.c.o.d -o subprojects/lai/liblai.a.p/core_vsnprintf.c.o -c ../subprojects/lai/core/vsnprintf.c
/bin/sh: 1: lemon-clang: not found
[12/226] Compiling C object subprojects/lai/liblai.a.p/helpers_pc-bios.c.o
FAILED: subprojects/lai/liblai.a.p/helpers_pc-bios.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/helpers_pc-bios.c.o -MF subprojects/lai/liblai.a.p/helpers_pc-bios.c.o.d -o subprojects/lai/liblai.a.p/helpers_pc-bios.c.o -c ../subprojects/lai/helpers/pc-bios.c
/bin/sh: 1: lemon-clang: not found
[13/226] Compiling C object subprojects/lai/liblai.a.p/helpers_pci.c.o
FAILED: subprojects/lai/liblai.a.p/helpers_pci.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/helpers_pci.c.o -MF subprojects/lai/liblai.a.p/helpers_pci.c.o.d -o subprojects/lai/liblai.a.p/helpers_pci.c.o -c ../subprojects/lai/helpers/pci.c
/bin/sh: 1: lemon-clang: not found
[14/226] Compiling C object subprojects/lai/liblai.a.p/helpers_resource.c.o
FAILED: subprojects/lai/liblai.a.p/helpers_resource.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/helpers_resource.c.o -MF subprojects/lai/liblai.a.p/helpers_resource.c.o.d -o subprojects/lai/liblai.a.p/helpers_resource.c.o -c ../subprojects/lai/helpers/resource.c
/bin/sh: 1: lemon-clang: not found
[15/226] Compiling C object subprojects/lai/liblai.a.p/helpers_sci.c.o
FAILED: subprojects/lai/liblai.a.p/helpers_sci.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/helpers_sci.c.o -MF subprojects/lai/liblai.a.p/helpers_sci.c.o.d -o subprojects/lai/liblai.a.p/helpers_sci.c.o -c ../subprojects/lai/helpers/sci.c
/bin/sh: 1: lemon-clang: not found
[16/226] Compiling C object subprojects/lai/liblai.a.p/helpers_pm.c.o
FAILED: subprojects/lai/liblai.a.p/helpers_pm.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/helpers_pm.c.o -MF subprojects/lai/liblai.a.p/helpers_pm.c.o.d -o subprojects/lai/liblai.a.p/helpers_pm.c.o -c ../subprojects/lai/helpers/pm.c
/bin/sh: 1: lemon-clang: not found
[17/226] Compiling C object subprojects/lai/liblai.a.p/drivers_ec.c.o
FAILED: subprojects/lai/liblai.a.p/drivers_ec.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/drivers_ec.c.o -MF subprojects/lai/liblai.a.p/drivers_ec.c.o.d -o subprojects/lai/liblai.a.p/drivers_ec.c.o -c ../subprojects/lai/drivers/ec.c
/bin/sh: 1: lemon-clang: not found
[18/226] Compiling C object subprojects/lai/liblai.a.p/drivers_timer.c.o
FAILED: subprojects/lai/liblai.a.p/drivers_timer.c.o
lemon-clang -Isubprojects/lai/liblai.a.p -Isubprojects/lai -I../subprojects/lai -I../subprojects/lai/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -g -MD -MQ subprojects/lai/liblai.a.p/drivers_timer.c.o -MF subprojects/lai/liblai.a.p/drivers_timer.c.o.d -o subprojects/lai/liblai.a.p/drivers_timer.c.o -c ../subprojects/lai/drivers/timer.c
/bin/sh: 1: lemon-clang: not found
ninja: build stopped: subcommand failed.

Ship a premade image

It would be cool for people that want to test the project, but don't want to build everything from scratch. Also, I tried to build it but I got a lot of unexpected problems (Compiler errors (with nyancat and lemond), Script permission problems (fixed with "chmod +x"), Non-existent headers (with lemond), etc.) and I'm pretty sure I installed all of the required dependencies for my distribution and followed exactly the build instructions.

Kernel/include/Math.h's floor definition makes no sense

The definition of floor(x) in Kernel/include/Math.h logically doesn't make sense. Flooring an integer is just itself, right?

Its definition is funny:

int floor(int num) {
    int x = (int)num;
    return num < x ? x - 1 : x;
}

So, it can never ever be the case that num < x, because x is simply num casted to an int, which it already is. Further, this function is never called in the entire codebase. I propose it should just be deleted.

docker install error

Scripts/docker-configure.sh

.......................
mlibc undefined

Subprojects
cxxshim: YES
frigg: YES

Found ninja-1.9.0 at /usr/bin/ninja

ERROR: Clock skew detected. File /mnt/c/ubuntu/Lemon-OS/LibC/build/meson-private/coredata.dat has a time stamp 0.0942s in the future.

A full log can be found at /mnt/c/ubuntu/Lemon-OS/LibC/build/meson-logs/meson-log.txt
ninja -j12 -C LibC/build install
ninja: open build.ninja: No such file or directory
make: *** [Makefile:8: libc] Error 1

TCP recieves invalid packets during longer transmissions

During a longer TCP transmission (such as downloading a file with curl), after a while the packets will become invalid, with invalid checksum and sequence numbers as follows:

[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0x82ff, should be: 0x83ff) seq: 2589917952
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0x9bff, should be: 0x9cff) seq: 3799647232
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0x66ff, should be: 0x67ff) seq: 1256457472
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0xf4ff, should be: 0xf5ff) seq: 3800499712
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0xe5fe, should be: 0xe6fe) seq: 3404662272
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0xb6ff, should be: 0xb7ff) seq: 43584512
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0x98fe, should be: 0x99fe) seq: 184028672
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0xe7ff, should be: 0xe8ff) seq: 3664977152
[WARN]    [Network] [TCP] Dropping Packet (invalid checksum 0x8dfe, should be: 0x8efe) seq: 2462392832

To reproduce:

  • Make sure in Kernel/src/Debug.cpp, debugLevelNetwork is at least DebugLevelNormal
  • Run in terminal curl -O api.lemonos.org/Clearnight.jpg

The packets are completely valid when inspected in Wireshark.

xbstrap: Action configure of package mlibc-headers failed

I am following the building instructions but seems like a problem occurs
xbstrap install-tool --all

the last few lines before it happens;

make[4]: Leaving directory '/home/jim/Build/LemonOS/Build/tool-builds/host-binutils/ld'
make[3]: Leaving directory '/home/jim/Build/LemonOS/Build/tool-builds/host-binutils/ld'
make[2]: Leaving directory '/home/jim/Build/LemonOS/Build/tool-builds/host-binutils/ld'
make[1]: Leaving directory '/home/jim/Build/LemonOS/Build/tool-builds/host-binutils/ld'
xbstrap: Running ['ln', '-sf', 'x86_64-lemon-ld', '@PREFIX@/bin/x86_64-unknown-lemon-ld'] (tools: ['host-bison', 'host-automake', 'host-autoconf-v2.69'])
xbstrap: Running ['ln', '-sf', 'x86_64-lemon-as', '@PREFIX@/bin/x86_64-unknown-lemon-as'] (tools: ['host-bison', 'host-automake', 'host-autoconf-v2.69'])
xbstrap: configure mlibc-headers [9/38]
xbstrap: Running ['meson', '--cross=@SOURCE_ROOT@/Scripts/lemon-crossfile.txt', '-Dheaders_only=True', '--prefix=/system', '@THIS_SOURCE_DIR@'] (tools: [])

ERROR: Neither directory contains a build file meson.build.
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
xbstrap: Action configure of package mlibc-headers failed

Build Error

System Specs:
Windows: 11
Processor :- intel i5
Ram : 16GB

commands:

git clone  https://github.com/LemonOSProject/LemonOS.git

cd LemonOs/Scripts

sudo ./docker-init.sh
ERROR: Neither directory contains a build file meson.build.
Traceback (most recent call last):
  File "/usr/local/bin/xbstrap", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/xbstrap/__init__.py", line 896, in main
    args._impl(args)
  File "/usr/local/lib/python3.10/dist-packages/xbstrap/__init__.py", line 867, in do_execute_manifest
    xbstrap.base.execute_manifest(manifest)
  File "/usr/local/lib/python3.10/dist-packages/xbstrap/base.py", line 1697, in execute_manifest
    subprocess.check_call(args, env=environ, cwd=workdir, stdout=output, stderr=output)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', '--cross=/var/LemonOS/Scripts/lemon-crossfile.txt', '-Dheaders_only=True', '-Dlinux_kernel_headers=/var/LemonOS/Build/packages/linux-headers/usr/include', '--prefix=/system', '/var/LemonOS/mlibc']' returned non-zero exit status 1.
xbstrap: Action configure of package mlibc-headers failed

Alpha build 0.1.0 hangs under QEMU

What happens?

It just completely hangs at the boot screen, roughly at what I assume is the progress bar middle point.

I have tried running it under no forced graphics mode, same result, just different resolution.

Notes

I've noticed it gets stuck using 100% CPU
And it completely stops using the disk after getting stuck, resulting in 0 KiB/s reads and writes.

Screenshot

image

Kernel Syscall Rework

Pretty much every syscall needs to be rewritten to some extent.

  1. Use syscall instruction instead of int
  2. Ensure userspace addresses are safely accessed
  3. Separate out architecture specific code for future support for other architectures such as arm64 or riscv
  4. Separate the syscalls into separate files not just for readability but so the compiler does not need to recompile thousands of lines of code every time a syscall or one of the many headers is touched
  5. Consider distinguishing between posix/linux-like syscalls and lemon-specific syscalls
  6. Consider allowing userspace to read various parts of kernel memory to avoid entering the kernel for example system uptime, process ID, thread ID

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.