2 Questions...
1. Does anyone know where I can go to learn more about how a Linux system works from an architecture point of view? I understand the basic concept of an OS (Command -> System -> Kernel), but I really want to get specifics on the Linux systems.
2. Say I wanted to add my own little function in Linux. Now I'm not really sure where it would need to go, so stay with me here. I'd basically like to be able to say "chris -message" (just like 'man', 'rm', etc) in the command line and get some random message printed out. Instead of writing my own program to do so, I'd like this built into the kernel (again, I'm not sure if it's build into the kernel or command level system). Any input is very welcome! Thanks. :) |
Well, for your second question, you can use Bash Aliases.
in your /home/user/.bashrc file (you may have to create it) , add things like: alias "chris -message"="fortune" Now whenever you type "chris -message" at a command line, the "fortune" command will be executed. This is just an example. |
Not quite what I'm lookin for...
|
Could you expand more on what you are looking for then? I started to reply with the above option, but figured you meant something else. But couldn't really figure out what?
Cool |
Quote:
Does that make better sense? |
Sure. Whatever you call yout binary that you create with C (I'm quite rusty on programming, but I think it's an a.out binary or elf binary right, well whatever you rename a.out to) simply place that in your PATH and call it just like you do with ls and such.
Is that what you mean? If you need help with the code that's a different story, but scripting it to call something would be a piece of cake. ;) Cool |
I know I could do it that way, by just writing a program and adding it to my path. So when I ran the command, the system picked it up.
But, I was hoping to intergrate this into my system from a kernel level or something. |
I'm not really sure I see the point, other than just doing it. ls cp and modprobe aren't kernel level programs. Do you mean to write a daemon? Still wouldn't be too hard, look into xinet.d and inetd.
Possibly look into kernel patches to see if that's what you are talking about. Cool |
There really is no "point". I just wanna fool around I guess. :D
|
:D
Sounds cool then ;) I think for an application like that, daemons would be as close as I'd go. Cool |
|
All times are GMT -5. The time now is 01:00 AM. |