jotaOS TODO list

This file is an automated ORG export, so it's pretty convenient for me.

This is not exactly a TODO list but more of a file to keep my thoughts sorted. Some parts have just the title, some parts are explained in depth so I don't forget about the specifics.

1 TO DO LIST

1.1 Microkernel

Moving to a microkernel :)

How should I do the MPI? I want it to be kind of privileged, so that a process can only communicate with a set of others (the editor must not communicate directly with the IDE driver).

1.2 STL in std namespace

1.3 COW

Copy-on-write would improve the process creation a whole lot. Also, it's really easy to do on shared libraries.

1.4 x86-64 (?)

Moving to x86-64 :p If I end up doing this, then next thing would be ASLR.

1.5 My own allocator

Will stop using liballoc and make my own, even though it will probably be worse.

1.6 Multicore

1.6.1 Change PIT to some other thing

1.7 Smash stack protection

Should just be a really simple library.

1.8 Simplify JOTAFS

Remove FIFO and suction pipe and socket. All of them, gone.

The kernel of jotaOS is a microkernel. Therefore, IPC is critical and will be built directly on the methodology, not as a special file.

1.9 Fix keyboard bug with latin-1

1.10 A boolean

That checks if the current filesystem has been written into since boot. Should be part of the DMA implementation.

This could make it really more resistant to mistakes.

1.11 Arguments library (for managing arguments in a somewhat standard way)

Something that allows «-a -b» and «-ab» and sometimes «ab»…

1.12 Good coreutils

1.12.1 pwd

1.12.2 cd (shell)

1.12.3 ls

1.12.4 nef (New Empty File)

1.12.5 mkd (Make directory)

1.12.6 rd (Read file)

1.12.7 rm (Trash files) and RM (caps, really remove files)

«RM» can be a symlink to «rm», and it should be able to detect what's the name of the binary when called, like «bash» with «rbash».

1.12.8 rmdir (Remove empty directories)

1.12.9 bare (A really simple editor)

I might change the name to something cooler.

It will have its own format (dot something, don't know which one atm) that I will make up.

25x80 editor, similar to the basic interpreter of the C64. There are no "lines" per se but a character stream that fills the whole screen, which will be full with spaces.

The user will be able to change foreground (Ctrl+F) and background (Ctrl+B) and so on.

It will also be not just a file, but more like a package of documents, each linked to others through hyperlinks like a webpage. In each document the user will be able to set a custom font (but not in a part of a document, as that's impossible to do in text mode).

1.12.10 And a bunch more that I'll be writing here when come to mind

1.13 Check ELFs are sane!

No offset must be left unchecked.

1.14 Physical memory manager

Improve paging (no bruteforce!) by having a linked list in the free pages. Or, even better, do like PID allocation.

1.15 Improve paging allocator

Do not kernel panic immediately if low on memory, start killing low priority processes.

1.16 Users, groups, and permissions

Users and groups have granular syscall permissions. If a user has the bit of managing the other bits high, it can only enable and disable those it has to high. I think it's a great design!

Superuser will be «high», as it has access to all syscalls (all bits set to high, that is, one). It will be the only user created at installation.

Also, permissions; in the neat way I've designed. Don't copy it here because it's in Spanish and it's a long explanation I am not willing to translate.

1.17 — ONCE REACHED THIS POINT, jotaOS IS A STABLE SYSTEM

1.18 KPTI

1.19 COW in "string".

1.20 Lock interface

For making locks easily. All siblings share the same "lock space", and can lock/unlock IDs (0, 1…).

1.21 Cool MSS

The shell will have cool syntax. Curly braces will copy the contents to a temporal file, pass the defined context (variables) and execute it. On return, context is updated. This way, for can be an actual program, and we can do something like:

for i in [0 1 2 3] {
    echo $i
}

Which will actually run:

for i in [0 1 2 3] /tmp/MSS/curly-INCREMENTAL_ID.mss

Don't know if variables will be with $ tho. Have to think about what makes sense the most.

Code blocks will also be able to be assigned to variables, and this way I will create functions.

hello = {
    echo $1
}

This will make very intuitive passing function as arguments to another function and such.

For this, a specific curly variable type must be implemented.

1.22 SWAP

Page faults and such.

1.23 Time (RTC)

JOTAFS needs it lmao.

1.24 Registry

Kind of like in Windows, or maybe like a database out of the box, for letting applications store data encrypted with a key only "one" knows. Have to think more about it, don't know how it will be nor whether it will have any use at all.

1.25 Math library

1.25.1 BigInt

Karatsuba, of course.

1.25.2 GCD - Euclidean algorithm

1.25.3 Montgomery reduction

Enter and leave montgomery representation.

When leaving montgomery representation, always substract something. Zero in case n < p, p otherwise. This should be implemented in assembly so no compiler optimization is performed.

https://www.youtube.com/watch?v=2UmQDKcelBQ

1.25.4 modpow(a, b, m)

Do repeated squaring: https://www.youtube.com/watch?v=4Mlb4ElyyIw

Do not do sliding windows. Maybe implement it as optional? In that case, I should get clear that is not suitable for cryptographic use.

1.25.5 unsecure_random() - MT19937

1.25.6 Primality tests

Make an interface «PrimalityTest» and implement the following:

  1. Slow (don't know how it's called right now)

    The one which checks all numbers below sqrt(n).

  2. Fermat's

    Just for completeness. It's easy to implement so it would be nice to have it even though it's mostly useless for the crypto library.

  3. Miller-Rabin
  4. AKS

1.26 Network

1.26.1 Network driver - RTL8139

1.26.2 ARP

1.26.3 IP

1.26.4 ICMP

1.26.5 UDP

1.26.6 DHCP

1.26.7 Program: connect

Sets up a connection (loads drivers and stuff, they do not need to be loaded with the system at boot).

connect <profile>

1.26.8 DNS

1.26.9 TCP

1.26.10 Network driver - Intel Ethernet i217

1.26.11 Network driver - Am79c970A

1.27 HTTP

1.28 Crypto library

Write in the README that I'm a hobbyist, that I don't know what I'm doing, and warn that this must not be used in real scenarios.

1.28.1 Hashing

  1. Pearson hashing

    You know, for starting easy.

  2. MD5
  3. SHA
    1. SHA-2
    2. Maybe SHA-3?

1.28.2 Utils

  1. CSPRNG

    This will NOT be in the crypto library. I put it here for keeping the step-by-step thingy. This will be part of the kernel.

    I want several entropy pools of n bits each, and I must focus on the topic of joining them together. Linux's «random» uses a CRC-like approach. I might just XOR them together.

    Stuff to keep in mind:

    1. Standard whitening (Von Neumann - drop 00 and 11, 01=0, 10=1)
    2. rdrand only in conjunction to the other stuff, never by itself
    3. Latency of hard disk accesses.
    4. [Maybe a bad idea] DakaRand: https://dankaminsky.com/?s=dakarand
    5. SipHash: https://en.wikipedia.org/wiki/SipHash
    6. Measure the real time clock (KHz) with the CPU (GHz)
    7. «My preferred CSPRNG»

      According to Dan Kaminsky: SipHash(Secret || Counter++ || PreviousOutput || ShiftedTime)

      ShiftedTime is CLOCK_MONOTONIC shifted by some absolute amount so the attacker can't just look up the global time and predict bits

      PreviousOutput means if ShiftedTime only has one shot to repeat

  2. nextPrime()

    Receives a «PrimalityTest» object. It's really simple.

    1. Even? Add one.
    2. Call the primality test.
    3. Not prime? Add 2. Go to 2.
  3. Prime number generator (of at least n bytes)

    Trivial, should be an inline function. nextPrime(random(), test). Where random() is the really nice kernel CSPRNG, and test is the «PrimalityTest» object received as a parameter.

  4. Curve25519

1.28.3 Encryption algorithms

  1. RSA (PKCS #1 v2.2)

    Receives an OPTIONAL «PrimalityTest» object. Default will be Miller-Rabin. I should learn OAEP in depth, and read the PKCS #1 standard if it's not too long.

    1. CRT optimization
  2. Diffie-Hellman
  3. ECDH
  4. AES

    If AES-NI check turns out positive, we're mostly done. I could just rely solely on AES-NI and fail miserably otherwise. How common is that set of instructions in CPUs? I don't care about supporting really old systems.

    1. AES-NI check
    2. Only GCM

1.29 ASLR

Easy once I have the CSPRNG.

1.30 Certificates

Include just jotaOS' CA. There will be then a package for installing the commonly trusted CAs.

1.31 Package manager

Wanna call it tusm (The Unified Software Manager). HTTP based with signed packages, or directly HTTPS. Made in MSS (rather than C++) so that I am forced to extend the capabilities of the shell.

1.32 HTTPS

1.33 SSH server

At this point, I will mark jotaOS as finished. I will probably still add new stuff (see below), but when I have an SSH server I'll be done.

1.34 — BEYOND THIS POINT, jotaOS IS "FINISHED"

1.35 SFTP?

1.36 Sound

1.37 Tetris

1.38 DMA

Not a priority since I have my new cool IDE driver. I don't know where to put this, so I might do it earlier, or never. Who knows.

1.39 GUI?

1.40 Web browser?

This would be a huge lot of effort.

2 Notes (outside the TODO)

2.1 Directory structure

2.1.1 /bin (binaries)

2.1.2 /cnf (global config files)

2.1.3 /home (for users and local configs)

Author: José Luis

Created: 2020-08-02 Sun 14:05

Validate