orion40 wrote:
However, do you know some up to date resources I could use ? It seems most books on the subjects are more than a decade old.
You don't need much if anything modern for a simple compiler. The 80386 was released in 1986. The first two versions of the C standard were released in 1989 and 1999 respectively. The ELF format (on UNIX/Linux) supports x86 since 1999. The PE format (on Windows) exists since 1993. The latest CPU documentation and compiler books and papers are needed for complex optimizing compilers.
About the only up to date documentation you need is for the OS system calls. And even those probably haven't changed much if we consider the most basic ones for file/console I/O, memory management, starting/terminating a process. For example, my
Smaller C compiler supports Windows from XP (released in 2001) and up using the same subset of about 30 functions exported by kernel32.dll.
orion40 wrote:
While I'm at it, what kind of resources would be essential ? Language theory of course, probably Intel software books, probably a C book since I probably don't even know about half its syntax...
Right. The Smaller C project on github lists a few useful ones in the readme. The OS dev wiki should give more links.
orion40 wrote:
Are you making a linker as well, or are you outsourcing to ld ? I guess I should focus on just a simple compiler ?
I wrote everything except two things: the assembler (NASM/YASM or FASM is needed) and the preprocessor (I found ucpp and minimally adapted it).