O_RDONLY, O_WRONLY, O_RDWR, O_TRUNC, O_CREAT and O_EXCL are fully implemented. O_APPEND is partially implemented. Other flags are not here yet.
This commit adds open and close syscalls to the kernel, and adds matching wrappers to libc. No read/write support, so file descriptors are kind of useless for now.