I get to see my name and picture on a git log alongside Linus Torvalds's.
https://github.com/akkartik/kernel#readme
I get to see my name and picture on a git log alongside Linus Torvalds's.
https://github.com/akkartik/kernel#readme
Now that we have a bootstrapped (quasi-) language and (kinda) bootstrapped OS, we're finally starting to think about less error-prone notations.
This week two of us built a notation for x86 addressing modes:
%ecx
*ecx
*(ecx+4)
*(ecx + edx<<3 + 4)
Not yet sure this is a good approach. But it'll be fun to playtest.
Here's before and after screenshots for factorial.subx.
Before:
After:
Today's little mini-experiment: a program to print out random numbers in an infinite loop. Works fine on Linux or Mac, but only prints zeroes when packaged up with my kernel fork and run on Qemu or Linode. Looks like I need to do something to initialize /dev/random.
Here's my complete current list of ideas, just for triggering serendipity:
LoC down from 6.1M to 4.4M.
Context: https://github.com/akkartik/mu#readme
I've been noodling on a Forth-inspired (but likely insane) syntactic sugar for stack manipulations in raw machine code. Behold:
{ 0 0 ->%ecx
...
}
This expands to:
push 0/imm32
push 0/imm32
copy %esp to %ecx
...
add 8 to %esp
Basically you get a (fairly unsafe) block scope containing an 8-byte local in %ecx.
To temporarily spill a register:
{ %ecx
...
}
Function call:
{ z y x
call f/disp32
}
The `}
` turns into code to undo pushes in the `{
` line.
I'm going to start changing the kernel soon, and I need a way to not kill myself merging patches from upstream. For starters: aggressively delete code Mu doesn't need. That'll reduce merge conflicts.
In the first run I just deleted non-x86 architectures. So far so good.
$ git clone https://github.com/akkartik/mu
$ cd mu
# package up a "hello world" binary and Linux kernel into mu.iso
$ ./gen_iso examples/ex6.subx
# try it out
$ qemu-system-x86_64 -m 256M -cdrom mu.iso -boot d
https://github.com/akkartik/mu#readme
The process is still fairly klunky, and I've added several large dependencies. But now that I have something working I can start polishing it.
Credit: http://minimal.linux-bg.org/
One aspect that seems more broadly useful than just my own Assembly language project: how to deploy bootable disk images on Linode.
I just successfully built a minimal Linux kernel, installed a SubX binary as init -- and ran the whole thing on a Linode.
It's not in https://github.com/akkartik/mu yet, but there will soon be step-by-step instructions.
This couldn't have happened without the education I received from http://minimal.linux-bg.org
https://github.com/akkartik/mu/blob/37c859058/apps/desugar.subx#L440
open()
?
I've spent some time in the past staring at the abyss that is http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html, and much of its complexity seems needed only for Things That Are Not Files.
At the syscall level it's pretty ugly that sockets are not files. Alternative client-side syscalls that unify file system and network:
Just have them take a resource name and maybe a Go channel for synchronizing. What am I missing?!