之后在 kernel 行,最后面加上 init 3 (注意空格)
或许你的系统可以启动到运行拿卖级 3。
之后修改 inittab 。
不然找个 LiveCD 启动计算机,修改硬盘上的 /etc/inittab
----------
update:找个 ubuntu 的 LiveCD ,图形的,尺腊之后 sudo 运行一个 gedit 修改,你要是还不明白怎么改,重装吧……
链接地址是指在CPU寻址范围内的物理地址。一般0地址尺棚是给RAM的。
nand地址不属于陪耐CPU寻陵乱则址范围,你可以把它当作串行设备。
前4K内容到内存执行,一般是指片内的RAM,这时候外部的SRAM还不能使用。
外部的SRAM一般物理地址不会是0。
链接地址0就是绝对地址0了!
你说的问题我也不太懂,不过我这有些代码可以给你参考下:建立一个新的进程forkdemo1.c:
/* forkdemo1.c
* shows how fork creates two processes, distinguishable
* by the different return values from fork()
*/
#include <stdio.h>
main()
{
int ret_from_fork, mypid
mypid = getpid() /* who am i? */
printf("Before: my pid is %d\n", mypid) /* tell the world */
ret_from_fork = fork()
sleep(1)
printf("After: my pid is %d, fork() said %d\n",
getpid(), ret_from_fork)
}
子进程创建进程frokdemo2.c:
/* forkdemo2.c - shows how child processes pick up at the return
* from fork() and can execute any code they like,
* even fork(). Predict number of lines of output.
*/
main()
{
printf("my pid is %d\n", getpid() )
fork()
fork()
fork()
printf("After, my pid is %d\n", getpid() )
}
分辨父进程和子进程forkdemo3.c:
/* forkdemo3.c - shows how the return value from fork()
*allows a process to determine whether
*it is a child or process
*/
#include <stdio.h>
main()
{
int fork_rv
printf("Before: my pid is %d\n", getpid())
fork_rv = fork() /* create new process */
if ( fork_rv == -1 ) /* check for error */
perror("fork")
else if ( fork_rv == 0 )
printf("I am the child. my pid=%d\n", getpid())
else
printf("I am the parent. my child is %d\n", fork_rv)
}
父进程等待子进程的退出waitdemo.c:
/* waitdemo.c - shows how parent pauses until child finishes
*/
#include <stdio.h>
#define DELAY 2
main()
{
int newpid
void child_code(), parent_code()
printf("before: mypid is %d\n", getpid())
if ( (newpid = fork()) == -1 )
perror("fork")
else if ( newpid == 0 )
child_code(DELAY)
else
parent_code(newpid)
}
/*
* new process takes a nap and then exits
*/
void child_code(int delay)
{
printf("child %d here. will sleep for %d seconds\n", getpid(), delay)
sleep(delay)
printf("child done. about to exit\n")
exit(17)
}
/*
* parent waits for child then prints a message
*/
void parent_code(int childpid)
{
int wait_rv /* return value from wait() */
wait_rv = wait(NULL)
printf("done waiting for %d. Wait returned: %d\n", childpid, wait_rv)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)