I'm trying to run a Linux application and all I want to run is this one application off of boot. I need networking and that's all (no display, peripherals, etc.). I want no other applications running so that the application I run has 100% of the CPU. Is this possible?
It sounds like you are trying to set up a kiosk. Most guides around the Internet focus on a web browser like Firefox as the single application that runs. Take a look at this guide for ideas.
You can certainly run just one user application after booting the kernel. But it will not have 100% of the CPU because there will be some other kernel-related processes that must exist. This is commonly done in embedded-Linux devices, e.g. wireless routers. I also have first-hand experience doing this for a multi-threaded application.
Once the kernel has booted, an initialization or startup script is run. Read up on Linux runlevels and the init process. There are various startup schemes in use, so it is not possible to be specific. But Linux will allow you to configure exactly which applications and daemons will execute for your situation. Other than a startup file at root, the files that need modifying are in /etc, and in particular /etc/init.d
BTW unless you're somekind of superprogrammer or before you get a remote GDB server running, you're going to need somekind of debug console (either the PC console or a serial port) for your application. This will allow you to be notified of seg faults, bus errors and assertion failures. So plan on having somekind of "peripheral" besides "networking".
you can start kernel with
There are some system applications which are must be run, besides them, sure, you can dedicate the rest of the computer resources to that application. To have the very minimum you can take a look at really small Linux distros like TinyCore Linux etc.
Also it would depend on application itself too, what services it requires besides the network etc.
I think if you can provide more specific information you would get more detailed response.
Like what kind of app etc.
If you really want nothing but the Linux kernel, networking, and your application, the only way to do it is this:
I know it's possible for kernel modules to create processes - a simple
Minimal init hello world program step-by-step
Compile a hello world without any dependencies that ends in an infinite loop.
We cannot use
This creates a filesystem with our hello world at
And you should see a line:
on the emulator screen! Note that it is not the last line, so you have to look a bit further up.
Tested on Ubuntu 14.04.
You can also use C programs if you link them statically:
You can run on real hardware with a USB on
Great source on this subject: http://landley.net/writing/rootfs-howto.html
Landley also explains how to use
Next step: setup BusyBox so you can interact with the system: http://unix.stackexchange.com/a/203902/32558
"Real" distributions also use a single