LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Make kernel with basic commands (https://www.linuxquestions.org/questions/linux-general-1/make-kernel-with-basic-commands-383933/)

itz2000 11-17-2005 03:46 AM

Make kernel with basic commands
 
Hello,
I want to learn more about the Kernel/how to do stuff, so I gave myself a project!


I would like to have a kernel, with few stuff

Copy Command - from a source I will write a.k.a cd-rom to hardisk.
Burning Command (it has to have drivers to CDBURNER aswell then!)
Touch Screen - support it + I will design myown X-buttons to make a few stuff with it, within touch.



My project will be
An old computer + with 2 cdroms, 1 touch screen

when u insert to cdrom1 a disk which has info on it, and then you turn the computer on, you'll have few commands in touch screen, I.E "COPY THIS CD TO ANOTHER COPY"
If I click on it, it will start copying --> Burnning with the CDRW
so this computer will be only for backuping CDs (in the future I will add another option which will be "copy to HD" I will do it for 7 disks, and then "burn to DVD disk" option, and another button for "Clear HD of unnescery files".

What do you say? any suggestion? how can I do it? is it a good project? :]]
Some help would be nice guys (some sources, websites, etc will be great aswell!!!!).


:study:

freakyg 11-17-2005 10:38 PM

the kernel cannot do that stuff on its own.........

"cp" is part of the-- coreutils program--.........and you'll also
need the-- binutils program-- to get a system to boot as well.

itz2000 11-18-2005 03:36 AM

so I need to build the system from scratch? :S

inversecow 11-21-2005 08:43 AM

It's a problem that the kernel itself does not include all the needed components to do what you want to do (as I understand at least). CD Burning for example comes from having programs like "cdrecord" installed and configured on top of the running kernel. All the kernel does, is manage the layer between the user (you), and the system hardware (your computer).

itz2000 11-21-2005 09:17 AM

what do I need to learn to build such stuff?

sundialsvcs 11-21-2005 10:34 AM

I suggest that you look at Linux From Scratch, not to actually build such a thing but rather to get a better idea of what the various parts of "a Linux system" actually consist of, and how they work together. Also do a Google search for "kiosks."

The Linux kernel, which is the only part of "Linux" that actually is "Linux," is simply a very sophisticated hardware-control program. It controls hardware devices, including: the CPU(s); memory; disk devices; human-interface devices such as touch screens. But, it only "controls" them in the sense of making it possible for these devices to operate at all.

In the case of human-interface devices such as touch-screens and mice, the main program that is responsible for them actually doing something useful is XWindows or XOrg, both of which are actually normal user-programs which, like all programs, run in the environment provided by the kernel but are not part of the kernel itself. Applications which wish to run in a GUI-type environment connect to one of these programs to actually do it.

Application programs, including such fundamentals as "the shell" and the commands that we all commonly use, are the piece that decides what all of this hardware and fancy GUI-stuff is supposed to do to make us and our users happy.

So, now, let's sort out your original requirement... a special-purpose "kiosk" type application:
Quote:

My project will be
An old computer + with 2 cdroms, 1 touch screen
when you insert to cdrom1 a disk which has info on it, and then you turn the computer on, you'll have few commands in touch screen, I.E "COPY THIS CD TO ANOTHER COPY"
If I click on it, it will start copying --> Burning with the CDRW
so this computer will be only for backing-up CDs (in the future I will add another option which will be "copy to HD" I will do it for 7 disks, and then "burn to DVD disk" option, and another button for "Clear HD of unnecessary files."
Your actual description is somewhat jumbled -- intermixing a description of what you want to do with how you think you might do it -- so I edited down to just the "what."

(1) Kernel-wise, you need only the minimal device-driver support needed to allow the computer to recognize the touch-screen, the CD-ROMs, and the hard-disk. You also need support for the "filesystems" that are used on CD-ROMs, and the chosen filesystem for your hard-drive. Many optional parts of the kernel can be omitted. As soon as you have a system in which programs can "see" that these devices exist and can use them, the kernel portion of this project is complete.

(1a) Closely related to the kernel, you must have the basic set of core utilities that are needed to enable the machine to boot, to run a startup-sequence out of /etc/rc.d. You'll also need the shared-libraries, such as glibc, needed by all the programs you intend to run. Presumably you'll set up the system so that the default runlevel goes straight into the kiosk-world, while another runlevel provides you with the resources you need to install and debug the system, or to make administrative changes.

(2) Since you intend to use a touch-screen, you're talking about a GUI (Graphical User-Interface), so you're going to have X-Windows or XOrg running. It is a stripped-down version, at least in the normal runlevels, because this computer runs only one program most of the time.

(3) At the standard runlevel, this computer will run a dedicated program as its "logon shell," and anytime that program ends, init will be told to automatically restart it. This is what "boxes the user in" to doing this task and only this task. The dedicated program is the one that actually drives the user interaction with the device. It may fork() other "helper" programs to do some of the work, such as actually burning the CDs.

(3a) A sophisticated kiosk will usually encounter only humans who really want to use it to get a job done; but sometimes it will encounter adolescent humans ;) who only want to break it... or break-in to it. Or, maybe, well you know, "ka-ka occurs." One of the basic tenets of designing a computerized device is that, no matter what happens, it will not "lock up" and it will not die. This means that you must consider... what happens if the user of the machine is unexpectedly and inconveniently assassinated ;) while using the machine and does not do what he is supposed to do? What is every possible eventuality that could occur, every possible pathway through the complete task, and are every one of them covered?

(4) A kiosk-program normally keeps good records, because if the machine breaks down for a user, you're not there to see and diagnose the problem. It probably needs to keep a record of exactly what CDs were copied, say for royalty purposes (so you, as the owner of the device, can get paid).

(5) This is actually "a road well-traveled." You won't be the first person to build a kiosk, and there are actually dedicated programs out there which are building-blocks for kiosk applications. But it is an excellent exercise. What you want to do first, before you start to write anything, is research. Find out how Linux is put together; find out how kiosk building is done. My Google search on kiosk linux building turned up 350,000 hits. :) It is a valid and very-worthy exercise to "do it yourself," or at least to learn in detail how it would be done, whether or not you actually complete it.

itz2000 11-21-2005 10:44 AM

thanks alot guys!


All times are GMT -5. The time now is 01:05 AM.