nuta / kerla Goto Github PK
View Code? Open in Web Editor NEWA new operating system kernel with Linux binary compatibility written in Rust.
License: Other
A new operating system kernel with Linux binary compatibility written in Rust.
License: Other
It looks like I have encountered the limitation of grpc transfer file size, But I can't find where I can set this value.
BUILD testing
[+] Building 3.6s (17/42)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 536B 0.0s
=> [curl 1/8] FROM docker.io/library/ubuntu:20.04 0.0s
=> CACHED [curl 2/8] RUN apt-get update && apt-get install -qy build-essential curl sed 0.0s
=> CACHED [curl 3/8] RUN apt-get install -qy musl-tools 0.0s
=> CACHED [dropbear 4/11] RUN curl -fsSL --output tarball.tar.bz2 "https://matt.ucc.asn.au/dropbear/releases/dro 0.0s
=> CACHED [dropbear 5/11] RUN mkdir /build && tar xf tarball.tar.bz2 --strip-components=1 -C /build 0.0s
=> CACHED [dropbear 6/11] ADD dropbear/accept-empty-password-root-login.patch /build/accept-empty-password-root- 0.0s
=> CACHED [dropbear 7/11] ADD dropbear/localoptions.h /build/localoptions.h 0.0s
=> CACHED [dropbear 8/11] WORKDIR /build 0.0s
=> CACHED [dropbear 9/11] RUN sh -c 'patch --ignore-whitespace -p1 < accept-empty-password-root-login.patch' 0.0s
=> [dropbear 10/11] RUN ./configure CC=musl-gcc --enable-static --disable-largefile --disable-zlib --disable-sys 3.5s
=> => # checking for endutent... yes
=> => # checking for getutent... yes
=> => # checking for getutid... yes
=> => # checking for getutline... yes
=> => # checking for pututline... yes
=> => # checking for setutent... yes
=> CACHED [busybox 4/8] RUN curl -fsSL --output tarball.tar.bz2 "https://busybox.net/downloads/busybox-1.31.1.ta 0.0s
=> CACHED [busybox 5/8] RUN mkdir /build && tar xf tarball.tar.bz2 --strip-components=1 -C /build 0.0s
=> CACHED [busybox 6/8] WORKDIR /build 0.0s
=> CACHED [busybox 7/8] ADD busybox/config /build/.config 0.0s
=> [busybox 8/8] RUN yes n | make oldconfig && ln -s /usr/bin/ar /usr/bin/musl-ar && ln -s /usr/bin/stri 3.5s
=> => # ) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6]
=> => # (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW)
=> => # Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimu
=> => # m password length (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimum pass
=> => # word length (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW) Minimum password l
=> => # ength (PASSWORD_MINLEN) [6] (NEW) Minimum password length (PASSWORD_MINLEN) [6] (NEW)
failed to receive status: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5417870 vs. 4194304)
make[2]: *** [Makefile:193: build/kerla.initramfs] Error 1
make[1]: *** [Makefile:92: build-crate] Error 2
make: *** [Makefile:78: build] Error 2
At the moment Process::fork()
seem to clone the OpenedFileTable
while for proper multithreading we have to have shared access to opened files following clone(2)
semantics supported by the Linux Kernel.
Found during work on #88 and belongs to Multithreading
milestone (I can't add myself).
More details in the flags mask of clone(2)
, scroll down to CLONE_FILES
. I haven't checked yet how it's implemented in Linux Kernel.
Glibc, the de facto libc implementation in Linux, tends to use non-trivial Linux-specific features (/proc
) and it makes harder to support applications built with glibc. This issue aims to implement missing features needed to run the glibc-based hello world program.
Grepped through the code, I found nice TODO:
Lines 8 to 11 in 2ff75ca
We want to have
[Option::<Box<dyn FnMut() + Send + Sync>>::None; 255]
instead of
BTreeMap<u8, Box<dyn FnMut() + Send + Sync>>
as an IRQ handler's map.
If I get it right, I will make a pull request.
Github is nice and all for posting issues, but perhaps this project would benefit from a community chatroom somewhere?
I know I'd like to dive in and hack at a system call or two, but the real-time collaboration a chatroom could provide would help immensely.
I'd prefer a Discord server myself, but I'm amicable to anything really. Whatever it is, I think it's something @nuta should start to avoid any conflicts of interest :-)
At the moment Process::fork()
seem to clone the Arc<RootFs>
instead of content of the RootFs
itself, what leads to shared RootFs
between processes, not independent file system states.
Found during work on #88 and belongs to Multithreading
milestone (I can't add myself).
More details in the flags mask of clone(2)
, scroll down to CLONE_FS
. I haven't checked yet how it's implemented in Linux Kernel.
In the process.rs
:
pub struct Process {
// ...
pub(super) parent: Option<Weak<SpinLock<Process>>>,
// ...
}
for unnecessary level of indirection as Weak
can be empty and then .upgrade()
would return None
. I've made the change and it works fine, so PR coming.
As the title says. I think it would be fitting for Kerla to have a (most likely makeshift/temporary) logo. I'll submit a PR when I've come up with something (in the little time I have left today).
OS: Ubuntu 21.10 64bits
After upgrading my operating system, from Ubuntu 20.04 to Ubuntu 21.10 (and reinstalling some tools, like Docker, or qemu-*), and after building Kerla with the make
command... I cannot test it via make test
, instead, I have this error:
Any idea if there's any way to deal with this? I'm not sure it's really a bug, but so far it seems like it.
hello,everyoneοΌ
panic when make run. stack is:
[ 0.000] running init script: "/bin/sh"
[ 0.000] WARN: invalid ELF e_machine[ 0.000] panicked at 'failed to execute the init script: : ENOEXEC: This error originates from:
#1: ffff800000150d79 kerla::printk::capture_backtrace()+0x79
#2: ffff800000137633 kerla::result::Error::new()+0x23
#3: ffff800000137c07 <kerla::result::Error as c...la::result::Errno>>::from()+0x17
#4: ffff800000104247 <T as core::convert::Into>::into()+0x17
#5: ffff8000001a7b32 kerla::process::elf::Elf::parse()+0x782
#6: ffff8000001bca7c kerla::process::process::do_setup_userspace()+0x49c
#7: ffff8000001bc5c9 kerla::process::process::setup_userspace()+0x39
#8: ffff8000001b9bed kerla::process::process::Process::new_init_process()+0x4ed
', kernel/boot.rs:154:14
[ 0.000] 0: ffff800000150cfa kerla::printk::backtrace()+0x1a
[ 0.000] 1: ffff8000001185fa rust_begin_unwind()+0xea
[ 0.000] 2: ffff8000002966fa core::panicking::panic_fmt()+0x3a
[ 0.000] 3: ffff8000002a2366 core::result::unwrap_failed()+0xe6
[ 0.000] 4: ffff80000013da98 core::result::Result<T,E>::expect()+0x78
[ 0.000] 5: ffff80000018e05f kerla::boot::boot_kernel()+0x91f
[ 0.000] 6: ffff80000010a8a4 bsp_early_init()+0x94
[ 0.000] 7: ffff8000001001f4 halt()+0x0
branch: master 8f2fce6
os: big sur 11.6
cpu: apple m1
Has anyone have same problem?
As part of implementation exercise and familiarization with process guts of Kerla I'd like to implement getppid()
system call.
I'm opening this issue to track the implementation of the chmod
syscall
A key feature of Linux kernel - futex is not yet implemented.
For a start, two operations can be implemented:
FUTEX_WAIT
- Test if the value at the futex contains the expected value. If so, sleep.FUTEX_WAKE
- Wake up a number of waiters waiting on the futex word.A futex consists of a kernelspace wait queue that is attached to an atomic integer in userspace. I found something similar here which is used for implementing spinlock: wait_queue.rs
References:
@nuta I hope I am going in the right direction. I seek your valuable inputs to get started with the implementation.
I followed the steps outlined in HACKING.md on my M1 Macbook, and I'm getting the following error when trying make run GUI=1
I'm copying my entire qemu output, as I also get a ton of these TCG warnings:
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.f16c [bit 29]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512f [bit 16]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512dq [bit 17]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.rdseed [bit 18]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512cd [bit 28]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512bw [bit 30]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx512vl [bit 31]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512vbmi [bit 1]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.umip [bit 2]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512vbmi2 [bit 6]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.gfni [bit 8]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.vaes [bit 9]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.vpclmulqdq [bit 10]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512vnni [bit 11]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512bitalg [bit 12]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:ECX.avx512-vpopcntdq [bit 14]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EDX.spec-ctrl [bit 26]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EDX.ssbd [bit 31]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.80000001H:ECX.3dnowprefetch [bit 8]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.80000008H:EBX.wbnoinvd [bit 9]
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.0DH:EAX.xsavec [bit 1]
[ 0.000] available RAM: 0000000000000000-000000000009fc00 639KiB
[ 0.000] reserved: 000000000009fc00-00000000000a0000 1KiB
[ 0.000] reserved: 00000000000f0000-0000000000100000 64KiB
[ 0.000] available RAM: 0000000000100000-000000001ffe0000 510MiB
[ 0.000] reserved: 000000001ffe0000-0000000020000000 128KiB
[ 0.000] reserved: 00000000fffc0000-0000000100000000 256KiB
[ 0.000] cmdline: (empty)
[ 0.000] enabling PIT (i8254) timer: divisor=1193
[ 0.000] Booting Kerla...
[ 0.000] available RAM: base=63f000, size=505MiB
[ 0.000] initramfs: "/bin" (0B)
[ 0.000] initramfs: "/sbin" (0B)
[ 0.000] initramfs: "/etc" (0B)
[ 0.000] initramfs: "/dev" (0B)
[ 0.000] initramfs: "/tmp" (0B)
[ 0.000] initramfs: "/bin/cat" (12B)
[ 0.000] initramfs: "/bin/wget" (12B)
[ 0.000] initramfs: "/bin/nslookup" (12B)
[ 0.000] initramfs: "/bin/echo" (12B)
[ 0.000] initramfs: "/bin/touch" (12B)
[ 0.000] initramfs: "/bin/sleep" (12B)
[ 0.000] initramfs: "/bin/uname" (12B)
[ 0.000] initramfs: "/bin/tail" (12B)
[ 0.000] initramfs: "/bin/grep" (12B)
[ 0.000] initramfs: "/bin/env" (12B)
[ 0.000] initramfs: "/bin/head" (12B)
[ 0.000] initramfs: "/bin/clear" (12B)
[ 0.000] initramfs: "/bin/sh" (12B)
[ 0.000] initramfs: "/bin/busybox" (937KiB)
[ 0.000] initramfs: "/bin/dropbear" (369KiB)
[ 0.000] initramfs: "/bin/curl" (552KiB)
[ 0.000] initramfs: "/bin/httpd" (12B)
[ 0.000] initramfs: "/bin/dmesg" (12B)
[ 0.000] initramfs: "/bin/mkdir" (12B)
[ 0.000] initramfs: "/bin/dropbearkey" (245KiB)
[ 0.000] initramfs: "/bin/rmdir" (12B)
[ 0.000] initramfs: "/bin/mv" (12B)
[ 0.000] initramfs: "/bin/hello" (614KiB)
[ 0.000] initramfs: "/bin/ln" (12B)
[ 0.000] initramfs: "/bin/ls" (12B)
[ 0.000] initramfs: "/bin/cp" (12B)
[ 0.000] initramfs: "/bin/rm" (12B)
[ 0.000] initramfs: "/sbin/init" (130B)
[ 0.000] initramfs: "/etc/group" (10B)
[ 0.000] initramfs: "/etc/init.d" (0B)
[ 0.000] initramfs: "/etc/profile" (235B)
[ 0.000] initramfs: "/etc/resolv.conf" (19B)
[ 0.000] initramfs: "/etc/inittab" (45B)
[ 0.000] initramfs: "/etc/banner" (228B)
[ 0.000] initramfs: "/etc/passwd" (26B)
[ 0.000] initramfs: "/etc/init.d/rcS" (130B)
[ 0.000] initramfs: "/dev/.keep" (0B)
[ 0.000] initramfs: "/tmp/.keep" (0B)
[ 0.000] initramfs: loaded 43 files and directories (2MiB)
[ 0.000] pci: found a device: id=8086:1237, bar0=MemoryMapped { paddr: PAddr(0000000000000000) }, irq=0
[ 0.000] virtio-net: found the device (over PCI)
[ 0.000] pci: found a device: id=1234:1111, bar0=MemoryMapped { paddr: PAddr(00000000fd000000) }, irq=0
[ 0.000] virtio-net: found the device (over PCI)
[ 0.000] pci: found a device: id=1af4:1041, bar0=MemoryMapped { paddr: PAddr(0000000000000000) }, irq=11
[ 0.000] virtio-net: found the device (over PCI)
[ 0.000] virtio-net: MAC address is 52:54:00:12:34:56
[ 0.000] virtio-net: transmitting 299 octets (tx_ring=0, paddr=0000000000747000)
[ 0.000] running /sbin/init
[ 0.000] WARN: invalid ELF e_machine[ 0.000] panicked at 'failed to execute /sbin/init: ENOEXEC', kernel/boot.rs:142:10
Any help would be appreciated πββοΈ
IIUC it's essential to run event-driven programs like Node.js.
Run a testing program on CI to check the functionality.
This is big task to cover all flags this syscall supports, so this is not going to end up with one issue, especially as some testing in the process would be required.
This call is used by pthread_create()
in system libraries (I've checked musl source code so far), so it's crucial to support user space threading.
I would assign myself to this task, but I don't have such powers. Could we have project or milestone for multithreading?
I'm using archlinux and I installed the cargo and rustup dependencies , and docker,qemu,python3,gdb
and I'm getting this error
warning: kerla
(bin "kerla") generated 9 warnings (1 duplicate)
Finished dev [unoptimized + debuginfo] target(s) in 2.11s
make[1]: Leaving directory '/home/coolpp/github/kerla'
NM kerla.x64.symbols
/bin/sh: line 1: rust-nm: command not found
/bin/sh: line 1: rustfilt: command not found
SYMBOLS kerla.x64.elf
STRIP kerla.x64.stripped.elf
make: rust-strip: No such file or directory
make: *** [Makefile:67: build] Error 127
BusyBox v1.31.1 (2021-11-04 11:38:59 UTC) built-in shell (ash)
[ 0.038] [1:/bin/sh] syscall: open(44af99, 2, 0, 0, 0, 0)
[ 0.038] [1:/bin/sh] open("/dev/tty")
[ 0.040] [1:/bin/sh] syscall: fcntl(3, 406, a, a, 48, 0)
[ 0.041] [1:/bin/sh] syscall: fcntl(a, 2, 1, a, 48, 0)
[ 0.041] [1:/bin/sh] syscall: close(3, 0, 0, 0, 0, 0)
[ 0.042] [1:/bin/sh] syscall: ioctl(a, 540f, 9ffffed14, 0, 0, 0)
[ 0.043] [1:/bin/sh] syscall: getpgid(0, 540f, 9ffffed14, 0, 0, 0)
[ 0.044] [1:/bin/sh] syscall: rt_sigaction(14, 0, 9ffffec00, 8, 0, 0)
[ 0.045] [1:/bin/sh] syscall: rt_sigaction(14, 9ffffebe0, 0, 8, 0, 0)
[ 0.046] [1:/bin/sh] syscall: rt_sigaction(16, 0, 9ffffec00, 8, 0, 0)
[ 0.046] [1:/bin/sh] syscall: rt_sigaction(16, 9ffffebe0, 0, 8, 0, 0)
[ 0.046] [1:/bin/sh] syscall: rt_sigaction(15, 0, 9ffffec00, 8, 0, 0)
[ 0.047] [1:/bin/sh] syscall: setpgid(0, 1, 0, 8, 0, 0)
[ 0.048] [1:/bin/sh] syscall: ioctl(a, 5410, 9ffffed04, 8, 0, 0)
[ 0.049] [1:/bin/sh] syscall: wait4(ffffffffffffffff, 9ffffebec, 3, 0, 0, 0)
# x=$(echo)
[ 4.895] [1:/bin/sh] syscall: pipe(9ffffea40, 1, 451400, 2, 101010101010101, 3)
[ 4.896] [1:/bin/sh] syscall: rt_sigprocmask(0, 449d58, 9ffffe910, 8, 452150, 3)
[ 4.896] WARN: unimplemented system call: rt_sigprocmask (n=14)
[ 4.896] WARN: rt_sigprocmask: error: ENOSYS: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff80000014ba77 kerla::syscalls::SyscallHandler::do_dispatch()+0x9c7
#4: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#5: ffff8000001b6dbc x64_handle_syscall()+0x9c
#6: ffff800000100235 syscall_entry()+0x3d
[ 4.897] [1:/bin/sh] syscall: fork(0, 449d58, 9ffffe910, 8, 452150, 3)
[ 4.898] [1:/bin/sh] syscall: rt_sigprocmask(2, 9ffffe910, 0, 8, 452150, 3)
[ 4.898] WARN: unimplemented system call: rt_sigprocmask (n=14)
[ 4.898] WARN: rt_sigprocmask: error: ENOSYS: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff80000014ba77 kerla::syscalls::SyscallHandler::do_dispatch()+0x9c7
#4: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#5: ffff8000001b6dbc x64_handle_syscall()+0x9c
#6: ffff800000100235 syscall_entry()+0x3d
[ 4.899] [1:/bin/sh] syscall: close(4, 0, 0, 0, 0, 0)
[ 4.899] [1:/bin/sh] syscall: read(3, 9ffffea48, 80, 0, 0, 0)
[ 4.900] [2:/bin/sh] syscall: gettid(0, 449d58, 450438, 8, 452150, 3)
[ 4.900] WARN: unimplemented system call: gettid (n=186)
[ 4.900] WARN: gettid: error: ENOSYS: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff80000014ba77 kerla::syscalls::SyscallHandler::do_dispatch()+0x9c7
#4: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#5: ffff8000001b6dbc x64_handle_syscall()+0x9c
#6: ffff800000100235 syscall_entry()+0x3d
[ 4.901] [2:/bin/sh] syscall: rt_sigprocmask(2, 9ffffe910, 0, 8, 452150, 3)
[ 4.901] WARN: unimplemented system call: rt_sigprocmask (n=14)
[ 4.901] WARN: rt_sigprocmask: error: ENOSYS: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff80000014ba77 kerla::syscalls::SyscallHandler::do_dispatch()+0x9c7
#4: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#5: ffff8000001b6dbc x64_handle_syscall()+0x9c
#6: ffff800000100235 syscall_entry()+0x3d
[ 4.902] [2:/bin/sh] syscall: rt_sigaction(2, 9ffffe820, 0, 8, 452150, 3)
[ 4.903] [2:/bin/sh] syscall: rt_sigaction(f, 9ffffe820, 0, 8, 452150, 3)
[ 4.903] [2:/bin/sh] syscall: rt_sigaction(3, 9ffffe820, 0, 8, 452150, 3)
[ 4.903] [2:/bin/sh] syscall: close(3, 0, 0, 0, 0, 0)
[ 4.903] [2:/bin/sh] syscall: dup2(4, 1, 0, 0, 21, 0)
[ 4.904] [2:/bin/sh] syscall: close(4, 0, 0, 0, 0, 0)
[ 4.906] [2:/bin/sh] syscall: wait4(ffffffffffffffff, 9ffffe7ac, 1, 0, 0, 0)
[ 4.908] [2:/bin/sh] syscall: exit_group(0, 0, 451020, 0, 452050, 0)
[ 4.908] WARN: unimplemented system call: exit_group (n=231)
[ 4.908] WARN: exit_group: error: ENOSYS: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff80000014ba77 kerla::syscalls::SyscallHandler::do_dispatch()+0x9c7
#4: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#5: ffff8000001b6dbc x64_handle_syscall()+0x9c
#6: ffff800000100235 syscall_entry()+0x3d
[ 4.909] [2:/bin/sh] syscall: exit(0, 0, 3c, 0, 452050, 0)
[ 4.909] WARN: read: error: EINTR: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff8000001ada17 <kerla::result::Error as c...la::result::Errno>>::from()+0x17
#4: ffff8000001ab467 <T as core::convert::Into<U>>::into()+0x17
#5: ffff800000136cfe kerla::process::wait_queue...e::sleep_signalable_until()+0x1ae
#6: ffff800000152e4c <kerla::pipe::PipeReader a...s::inode::FileLike>::read()+0x7c
#7: ffff80000012dfcd kerla::fs::opened_file::OpenedFile::read()+0x14d
#8: ffff800000146276 kerla::syscalls::read::<im...SyscallHandler>::sys_read()+0x1d6
[ 4.909] delivering 17 to PId(1)
[ 4.910] [1:/bin/sh] syscall: rt_sigreturn(11, 0, 0, 0, 0, 0)
[ 4.910] WARN: rt_sigreturn: error: EINTR: This error originates from:
#1: ffff800000214179 kerla::printk::capture_backtrace()+0x79
#2: ffff8000001ad443 kerla::result::Error::new()+0x23
#3: ffff8000001ada17 <kerla::result::Error as c...la::result::Errno>>::from()+0x17
#4: ffff8000001ab467 <T as core::convert::Into<U>>::into()+0x17
#5: ffff8000001477f4 kerla::syscalls::rt_sigret...andler>::sys_rt_sigreturn()+0x44
#6: ffff80000014b577 kerla::syscalls::SyscallHandler::do_dispatch()+0x4c7
#7: ffff80000014a87c kerla::syscalls::SyscallHandler::dispatch()+0x1ac
#8: ffff8000001b6dbc x64_handle_syscall()+0x9c
[ 4.911] [1:/bin/sh] syscall: read(3, 9ffffea48, 80, 0, 0, 0)
[ 4.912] [1:/bin/sh] syscall: read(3, 9ffffea48, 80, 0, 0, 0)
[freezes here]
I've run the following command in my Linux machine (to see which syscalls are being sent to the kernel for a very basic NodeJS program):
strace echo "console.log('hello')" | node
and I've got the following list (taking aside the ones already implemented):
access
openat
pread64
mprotect
some of this calls could be related to Bash and not NodeJS, but if instead I run this:
strace node example.js # with the same JS script as before
we obtain this list (confirming that they are needed for NodeJS too):
access
openat
pread64
mprotect
munmap
set_robutst_list
rt_sigprocmask
prlimit64
pipe2
eventfd2
clone
madvise
futex
: #2epoll_ctl
: #19epoll_wait
: #19exit_group
I hope this can be useful to guide the next steps for this roadmap ( https://github.com/nuta/kerla/projects/1 ).
Right now, after we switch to MaybeUninit, we lose panic on irq_handler overwrite. But now it is even more important than before because MaybeUninit::write will not drop the previous value so that Box will live forever. Or, if I overthink, and this is not the real problem, this should be documented as a feature :)
I will be happy to provide a PR.
The debug build prints too much log messages. Implement something like $RUST_LOG
to control log levels.
I have to kill my SSH session to get control back. I've done it twice and it reproduces.
ls -lai works in root's homedir.
The big problem of MIT license is that the companies love take the project and close it or not colaborate in the main or parent project. Because MIT license has not the "Freedom 3: The freedom to improve the program, and release your improvements (and modified versions in general) to the public, so that the whole community benefits." .
There are a lot of links about this:
IMHO: GPLv3 is better.
Currently, Kerla doesn't print anything on the screen and it's confusing when you run it on QEMU (I suppose only few people know how to open the serial console).
To implement kernel extensions (#71), we need to isolate arch-specific stuff from the kernel crate. Moreover, it makes a lot easier to port Kerla to another CPU architectures like Arm.
I'm opening this issue to track the implementation of the lseek
syscall, as I plan to work on it. I'll iterate over the issue description by adding more "bullet points" as I improve my understanding of what's needed.
The 70d4c1c for #85 introduced problems with Make targets where generation of extensions loader isn't dependencies for all targets invoking cargo
, where root crate refers to the generated dependency.
Symptom:
error: failed to load manifest for workspace member `/home/manveru/projects/kerla/kernel`
Caused by:
failed to load manifest for dependency `kerla_kexts_loader`
Caused by:
failed to read `/home/manveru/projects/kerla/build/kexts_loader/Cargo.toml`
Caused by:
No such file or directory (os error 2)
make: *** [Makefile:142: check] Error 101
On the SSH connection:
# cd /bin
# ls
grep nslookup dropbear busybox mkdir hello
dropbearkey env sleep httpd cp uname
touch curl wget tail ln
ls mv clear rm head
echo rmdir sh dmesg cat
# ls -la
[ .... minutes later ... ]
Timeout, server kerla-demo.seiya.me not responding.
Great work! :)
Unrelated question (but this bug report can probably be closed anyway):
Can this also be developed on a Mac or do you need a VM or docker or such?
What the title says.
Currently, a process control block is wrapped with SpinLock
. It's not convenient because even if you just want to get its PID, you need to acquire the lock (proc.lock().pid()
)!
This issue aims to turn Arc<SpinLock<Process>>
into Arc<Process>
.
I've started to introduce minor changes into the documentation ( #14 ), and then I realized that just having a column specifying the status (Implemented / Unimplemented
) isn't really enough.
Having a column specifying the version when these syscalls were introduced (or main
if it's implemented but not yet released) could be really helpful for some users.
What do you say about making an "emergency release" so we can document what's available at the time being?
Currently. Kerla extensively uses containers provided by liballoc. The problem is they can panic on memory allocation failures. Use failable methods (i.e. returning Result<T>
) to improve the robustness.
it hang when ls -al /bin
BusyBox v1.31.1 (2021-05-28 14:16:49 UTC) built-in shell (ash)
# ls /bin
grep nslookup dropbear busybox mkdir hello
dropbearkey env sleep httpd cp uname
touch curl wget tail ln
ls mv clear rm head
echo rmdir sh dmesg cat
# ls -al /bin
Connection to kerla-demo.seiya.me closed by remote host.
Connection to kerla-demo.seiya.me closed.
I am very interested in this, but facing the operating system kernel I have no way of starting.
Currently, Kerla uses initramfs embedded into the kernel as its root file system.
The major disadvantage is that the all file contents will be loaded into the memory. That is, if you want to run a 100MiB Docker image, 100MiB needs to be reserved for initramfs!
This issue is aims to allow running large Docker images by:
I was looking over the discussions on the licensing and tried to address them as best I could with an amended file and added clarity but wanted to run it by here first and get some thoughts before I open any kind of pull request π
One example being where someone said that MIT doesn't deal with patents even though in precedent for multiple jurisdictions (inc European) it may be implied by the contract itself. #5
@nuta
Namely, write documentation and implement missing features to make following manifest work:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
runtimeClassName: kerla
containers:
- name: nginx
image: nginx
See https://kubernetes.io/docs/concepts/containers/runtime-class/
In smoltcp, the Kerla's TCP/IP implementation, there're some O(|# of sockets|)
loops and it would lead to a scalability issue in the future:
The priority is not that high, but it might be a good time to write our own TCP/IP protocol stack. I'd avoid to do so though.
It would be helpful for interested contributors if kerla has some documentation. I would like to help with that. It will also help me understand kerla (and Operating Systems in general) better so that I can contribute with some code later on.
@nuta if possible can you suggest a rough outline of how you imagine the documentation to be structured? I can start working and send in some pull requests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.