tccboot's Introduction
Introduction: ------------ WARNING: don't try to play with TCCBOOT unless you are a kernel hacker! TCCBOOT is a bootloader which uses TinyCC to compile C and assembly sources and boot the resulting executable. It is typically used to compile the Linux kernel sources at boot time. TCCBOOT boots the same way as a Linux kernel, so any boot loader which can run a 'bzImage' Linux kernel image can run TCCBOOT. I only tested it with ISOLINUX, but LILO or GRUB should work too. TCCBOOT reads C or assembly sources from a gzipped ROMFS filesystem stored in an Initial Ram Disk (initrd). It first reads the file 'boot/tccargs' which contains the TinyCC command line (same syntax as the tcc executable). The TinyCC invocation should output one binary image 'kernel'. This image is loaded at address 0x00100000. TCCBOOT then does a jump to the address 0x00100000 in 32 bit flat mode. This is compatible with the ABI of the 'vmlinux' kernel image. Compilation: ----------- TCCBOOT was only tested with Linux 2.4.26. In order to build TCCBOOT, you must first compile a 2.4.26 kernel because for simplicity TCCBOOT uses some binary files and headers from the Linux kernel. TCCBOOT also needs the source code of TinyCC (tested with TinyCC version 0.9.21). You can modify the Makefile to give the needed paths. Example: ------- An "Hello World" ROMFS partition is included (initrd.img). You can rebuild it from the example/ directory. You can test it with the QEMU PC emulator with the 'qemu-tccboot' script. Kernel compilation: ------------------ For your information, the patch 'linux-2.4.26-tcc.patch' gives the necessary modifications to build a Linux kernel with TinyCC. The corresponding kernel configuration is in file linux-2.4.26-config. Patches are necessary for the following reasons: - unsupported assembly directives: .rept, .endr, .subsection - '#define __ASSEMBLY__' needed in assembly sources - static variables cannot be seen from the inline assembly code - typing/lvalue problems with '? :' - no long long bit fields - 'aligned' attribute not supported for whole structs, only for fields - obscur preprocessor bug Some of these problems could easily be fixed, but I am too lazy now. It is sure that there are still many bugs in the kernel generated by TinyCC/TCCBOOT, but at least it can boot and launch a shell. License: ------- TCCBOOT is distributed under the GNU General Public License. Fabrice Bellard.
tccboot's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.