Skip to content

Instantly share code, notes, and snippets.

View klange's full-sized avatar
🤔
Contemplative.

K Lange klange

🤔
Contemplative.
View GitHub Profile
├─mod
│ ├─ata.ko
│ ├─debug_shell.ko
│ ├─vmware.ko
│ ├─ataold.ko
│ ├─zero.ko
│ ├─xtest.ko
│ ├─ac97.ko
│ ├─vgalog.ko
│ ├─packetfs.ko
Screen 0: minimum 8 x 8, current 5760 x 1080, maximum 32767 x 32767
DVI-D-0 connected primary 1920x1080+3840+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.00*+
1680x1050 59.95
1440x900 59.89
1280x1024 75.02 60.02
1280x960 60.00
1280x800 59.81
1280x720 60.00
1152x864 75.00
./libpython3.6m.so: undefined reference to `pthread_cond_signal'
./libpython3.6m.so: undefined reference to `pthread_getspecific'
./libpython3.6m.so: undefined reference to `pthread_key_delete'
./libpython3.6m.so: undefined reference to `pthread_detach'
./libpython3.6m.so: undefined reference to `pthread_key_create'
./libpython3.6m.so: undefined reference to `pthread_cond_init'
./libpython3.6m.so: undefined reference to `pthread_mutex_unlock'
./libpython3.6m.so: undefined reference to `pthread_self'
./libpython3.6m.so: undefined reference to `pthread_mutex_destroy'
./libpython3.6m.so: undefined reference to `pthread_mutex_lock'
#!/usr/bin/python
"""
tree.py - List directories in a visual tree.
"""
import os
def print_directory(path, prefix="", last=False):
if last:
extra = "└─"
else:
$ cloc kernel modules userspace linker
335 text files.
326 unique files.
8 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.81 s (392.9 files/s, 95002.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 202 7309 4988 37837
[0000000000.000:kernel/misc/multiboot.c:28] INFO: MULTIBOOT header at 0x00010000:
[0000000000.000:kernel/misc/multiboot.c:29] INFO: Flags : 0x0000126f
[0000000000.000:kernel/misc/multiboot.c:30] INFO: Mem Lo: 0x0000027f
[0000000000.000:kernel/misc/multiboot.c:31] INFO: Mem Hi: 0x000ffb80
[0000000000.000:kernel/misc/multiboot.c:32] INFO: Boot d: 0xe0ffffff
[0000000000.000:kernel/misc/multiboot.c:33] INFO: cmdlin: 0x00010078
[0000000000.000:kernel/misc/multiboot.c:34] INFO: Mods : 0x00000016
[0000000000.000:kernel/misc/multiboot.c:35] INFO: Addr : 0x000100e4
[0000000000.000:kernel/misc/multiboot.c:36] INFO: ELF n : 0x00000011
[0000000000.000:kernel/misc/multiboot.c:37] INFO: ELF s : 0x00000028
@klange
klange / Makefile
Created December 30, 2016 13:48
Makefile for building pycairo for ToaruOS
CC = i686-pc-toaru-gcc
CFLAGS = -I${TOOLCHAIN}/python/include/python3.6m $(shell pkg-config --cflags cairo) -DVERSION='"1.10.1"' -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=10 -DPYCAIRO_VERSION_MICRO=1
OBJS = cairomodule.o context.o font.o matrix.o path.o pattern.o region.o surface.o
all: _cairo.so
$(OBJS):
_cairo.so: $(OBJS)
#include <system.h>
#include <types.h>
#include <va_list.h>
#include <fs.h>
#include <printf.h>
#include <ubsan.h>
#define EARLY_LOG_DEVICE 0x3F8
static uint32_t _ubsan_log_write(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) {
for (unsigned int i = 0; i < size; ++i) {

tl;dr: Run:

qemu-system-i386 -vga std -m 512 -cdrom http://toaruos.org/netboot.iso -M accel=kvm:tcg \
  -soundhw ac97 -net user -net nic,model=rtl8139 -serial stdio

Netboot ToaruOS from a 3MB ISO

ToaruOS has a reasonably stable network stack under VirtualBox's and QEMU's user network modes, and we already run ramdisk-based systems on CDs, so why not write an application that gets that ramdisk from the network and have that be the only thing we ship?

Kernel Changes

@klange
klange / yutani.py
Last active December 13, 2016 05:49
#!/usr/bin/python3
"""
Bindings for the Yutani graphics libraries, including the core Yutani protocol,
general graphics routines, and the system decoration library.
"""
from ctypes import *
yutani_lib = None
yutani_gfx_lib = None