Hi,
beachkid wrote:
I am new here and I wanted to ask this question on how to add a shell?
Typically the OS provides various interfaces for user-related devices (keyboard, mouse, video, sound, etc); then you have a layer that talks to all of these (e.g. "X server") that is designed for modern event-driven user input (and not character streams) and modern (graphical) output; then you have some sort of terminal emulator layer (that may or may not run inside a GUI) that acts as a kind of a bridge between "modern, event-driven, graphical" and "antiquated character stream". Finally, after all of that, you have "shell".
beachkid wrote:
I already created the kernel using the Bare Bones tutorial but now I want to add a shell to the kernel The Wiki doesn't really explain on where to put the code do you add it to the kernel.c or do you have to make a separate file for it?
For all of the pieces I mentioned above; the device drivers are the only pieces that really belong in a kernel (and even then micro-kernel advocates would say device drivers don't belong in kernel either). Mostly; if all you have is "example/tutorial code cut&pasted from barebones" then you probably have less than 1% of the things you need for a real shell.
What you probably want is some kind of (temporary?) "kernel debugger thing" that you can use to interact directly with the kernel while you're spending then next several years implementing all the things you need for a shell. For this sort of "lean and mean, not a shell" you probably only need a keyboard driver (and all the stuff it depends on), a "generic frame buffer video driver" (and all the stuff it depends on), and (optionally?) some code to convert characters into pixels.
Cheers,
Brendan