Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i installed lilo boat-loader run /sbin/lilo -v -v to put it in my MBR of ubuntu 11.04
and made the following changes to my lilo.conf file
lba32
boot = /dev/sda
map =/boot/ System.map-2.6.38-8-generic
prompt
timeout = 50
compact
vga = extended
image = /boot/vmlinuz-2.6.38-16-generic
label = linux
root = /dev/hda5
initrd = initrd.img-2.6.38-16-generic
read-only
and run lilo then when i reload my system this is what happened
Bios data check successful.........
..........
...........
.
.
mount: mounting /dev/block/8:5 on root failed
Begin: Running /scripts/local.bottom ... done
done.
Begin: Running /scripts/init.bottom .......mount:mounting /dev on /root/dev faild :no such file or directory
mount: mounting /proc on /root/proc failed :no such file or directory
Target filesystem doesnot have requested /sbin/init. :no such file or directory
what is this and what is the solution pls help.
tnx!!!!
well u know i posted this,by the way it is a typo, coz i didnot understand it.if i new how to map to the kernel i wldn,t have posted this.I want some one who cld help me the mistakes i am commiting and how to correct them.
Distribution: Started with Slackware - 3.0 1995 Kernel 1.2.13 - Now Slackware Current. Also some FreeBSD.
Posts: 124
Rep:
Quote:
Originally Posted by micflunu
but i my system is SCSI.wld this work.and cld u give me some document to make me understand this things??
I need a document to understand what you wrote. Please write in complete words and sentences with proper caps and punctuation, it really helps us help you when we can understand what you are asking.
Anyway... hda (hdb, hdc etc) was used prior to kernel version 2.6.20 for IDE drives. Linux now uses sda (sdb, sdc etc) for all drives SCSI, SATA USB etc. So sda will work with your SCSI drive.
Last edited by Fred-1.2.13; 10-26-2012 at 06:08 PM.
I wrote the follwing code hopping i will build a mini shell executing the simple commands ls,chdir...
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/types.h>
#include<stdio.h>
#include<stdarg.h>
int countArgs(int num, ...)
{
va_list ap;
int i, t;
va_start(ap, num);
{
for(i=0; t = va_arg(ap, int); i++)
return t;
}
va_end(ap);
}
int main(int argc, char **argv)
{
//buffer is to hold the commands that the user will type in
char buffer[512];
// /bin/program_name is the arguments to pass to execv
//if we want to run ls, "/bin/ls" is required to be passed to execv()
char* path = "/bin/";
while(1)
{
//print the prompt
printf("myShell>");
//get input
fgets(buffer, 512, stdin);
//fork!
int pid = fork(); //Error checking to see if fork works
//If pid !=0 then it's the parent
if(pid!=0)
{
wait(NULL);
}
else
{
//if pid = 0 then we're at teh child
//Count the number of arguments
int num_of_args = countArgs(buffer);
//create an array of pointers for the arguments to be passed to execcv.
char *arguments[num_of_args+1];
//parse the input and arguments will have all the arguments to be passed to the program
parse(buffer, num_of_args, arguments); //set the last pointer in the array to NULL. Requirement of execv
arguments[num_of_args] = NULL;
//This will be the final path to the program that we will pass to execv
char prog[512];
//First we copy a /bin/ to prog
strcpy(prog, path);
//Then we concancate the program name to /bin/
//If the program name is ls, then it'll be /bin/ls
strcat(prog, arguments[0]);
//pass the prepared arguments to execv and we're done!
int rv = execv(prog, arguments);
}
return 0;
}
but i keep getting the following error message
/myshell.c: In function ‘countArgs’:
./myshell.c:53:17: error: ‘ap’ redeclared as different kind of symbol
./myshell.c:52:21: note: previous definition of ‘ap’ was here
./myshell.c:55:9: error: ‘n_args’ undeclared (first use in this function)
./myshell.c:55:9: note: each undeclared identifier is reported only once for each function it appears in
./myshell.c: In function ‘main’:
./myshell.c:60:2: error: expected declaration or statement at end of input
what is wrong???how cld i correct this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.