No edit summary
(change wording to a more encyclopedic tone)
(5 intermediate revisions by 2 users not shown)
Line 1:
Line 1:
Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C and C99 (minus some C89 and plus some C99 features).
Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C and C99 (minus some C89 and plus some C99 features).
The compiler self-hosts on DOS, Windows and (削除) Linux, (削除ここまで)meaning it can compile under and for all (削除) three (削除ここまで)OSes and it may additionally be used to write bootloaders and other parts OS running in [[Real Mode]], [[Virtual 8086 Mode]], [[Unreal Mode]] and 32-bit [[Protected Mode]].
The compiler self-hosts on DOS, Windows(追記) , Linux (追記ここまで)and (追記) Mac OS X (追記ここまで)meaning it can compile under and for all (追記) four (追記ここまで)OSes and it may additionally be used to write bootloaders and other parts OS running in [[Real Mode]], [[Virtual 8086 Mode]], [[Unreal Mode]] and 32-bit [[Protected Mode]].
With some work you may even be able to run Smaller C in your OS (e.g. you need to port [[NASM]]/[[YASM]] or [[FASM]] (FASM is probably easier) to your OS and make appropriate changes in the Smaller C standard library to use your OS system calls instead of those for DOS, Windows (削除) and (削除ここまで)Linux).
With some work you may even be able to run Smaller C in your OS (e.g. you need to port [[NASM]]/[[YASM]] or [[FASM]] (FASM is probably easier) to your OS and make appropriate changes in the Smaller C standard library to use your OS system calls instead of those for DOS, Windows(追記) , (追記ここまで)Linux (追記) or Mac OS X (追記ここまで)).
The core compiler comes with a preprocessor, a linker and a compiler driver (the driver invokes the preproccessor, the core compiler, the assembler, and the linker and supports options similar to those of [[GCC]]). The linker ([[smlrl]]) can produce the following executable formats: [[COM]], [[MZ]], [[PE]], [[ELF]], [[A.out]] and flat executables. (削除) Btw, (削除ここまで)[[COM]] and [[MZ]] may be booted directly with [[BootProg]].
The core compiler comes with a preprocessor, a linker and a compiler driver (the driver invokes the preproccessor, the core compiler, the assembler, and the linker and supports options similar to those of [[GCC]]). The linker ([[smlrl]]) can produce the following executable formats: [[COM]], [[MZ]], [[PE]], [[ELF(追記) ]], [[MACH-O (追記ここまで)]], [[A.out]] and flat executables. (追記) The produced (追記ここまで)[[COM]] and [[MZ]] (追記) executables (追記ここまで)may be booted directly with [[BootProg]].
The standard C library is work-in-progress and it's close to completion.
The standard C library is work-in-progress and it's close to completion.
(削除) Fun fact: (削除ここまで)Smaller C (削除) runs (削除ここまで)on [http://retrobsd.org/wiki/doku.php RetroBSD] on a [[MIPS Overview|MIPS]] microcontroller (削除) and fits (削除ここまで)into the 96KB of user memory.
Smaller C (追記) can run (追記ここまで)on [http://retrobsd.org/wiki/doku.php RetroBSD] on a [[MIPS Overview|MIPS]] microcontroller(追記) , fitting (追記ここまで)into the 96KB of user memory.
==See Also==
==See Also==
(追記) *[https://wiki.osdev.org/Unreal_Mode#Smaller_C Unreal mode - Compiler Support - Smaller C] (追記ここまで)
(追記) *[[BootProg]] (追記ここまで)
===External Links===
===External Links===
*[https://github.com/alexfru/SmallerC Smaller C project]
*[https://github.com/alexfru/SmallerC Smaller C project]
*[https://github.com/alexfru/SmallerC/wiki Smaller C documentation]
*[https://github.com/alexfru/SmallerC/wiki Smaller C documentation]
*[https://hackaday.io/project/5569-smaller-c Discuss Smaller C]
*[https://hackaday.io/project/5569-smaller-c Discuss Smaller C]
(追記) *[https://github.com/fysnet/FYSOS/tree/master/loader FYSOS bootloader written for/with Smaller C] (追記ここまで)
(追記) [[Category:C]] (追記ここまで)
[[Category:Compilers]]
[[Category:Compilers]]
Latest revision as of 17:09, 15 September 2025
Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C and C99 (minus some C89 and plus some C99 features).
The compiler self-hosts on DOS, Windows, Linux and Mac OS X meaning it can compile under and for all four OSes and it may additionally be used to write bootloaders and other parts OS running in Real Mode, Virtual 8086 Mode, Unreal Mode and 32-bit Protected Mode.
With some work you may even be able to run Smaller C in your OS (e.g. you need to port NASM/YASM or FASM (FASM is probably easier) to your OS and make appropriate changes in the Smaller C standard library to use your OS system calls instead of those for DOS, Windows, Linux or Mac OS X).
The core compiler comes with a preprocessor, a linker and a compiler driver (the driver invokes the preproccessor, the core compiler, the assembler, and the linker and supports options similar to those of GCC). The linker (smlrl) can produce the following executable formats: COM, MZ, PE, ELF, MACH-O, A.out and flat executables. The produced COM and MZ executables may be booted directly with BootProg.
The standard C library is work-in-progress and it's close to completion.
Smaller C can run on RetroBSD on a MIPS microcontroller, fitting into the 96KB of user memory.
See Also
External Links