Kernel FAQ (2001.05.06 ~ 2001.05.16)

zhaozj2021-02-11  225

Kernel FAQ (2001.05.06 ~ 2001.05.16) http://linuxaid.com.cn

Axing

Back to〗 Forward〗

1. Will the LINUX startup process 2, is it necessary to install after the version is recompiled? 3, compile 8390.c, one problem 4, LKM kernel programming problem 5, SK_BUFF6, compiled the loadable kernel module on the blue dot Linux 2.2.13 1, please ask the LINUX startup process BIOS read bootsect.s, bootsect.s Read setup.s and kernel, then give the control to setup.s, then? What role does KERNEL play in the boot process? I know that Loading ... is that bootsect is reading the kernel, then other information is when doing? Also, what role in rc.system and rc.local start? I am still very confused for the Linux boot process. Please give me a guidance, thank you. Setup.s is preparing for the start of the protection mode, the purpose is to establish the kernel's operating environment. When controlled to Head.s, the work is mainly established a 4M page table and an IDT table that can't do anything. And build the stack of init. Finally jump to the Start_kernel this C function. In this regard, work will continue to be more advanced on the basis of the 4M memory mapping that has been established in front. The basic process is: bios-> bootsect.s-> setup.s-> head.s-> start_kernel-> init-> do_basic_setup-> Create an init process. Other information is mostly printed in do_basic_setup, mainly information on various devices. Rc.sinit and rc.local are explained in the init process. It is mainly to create some wizard processes and initialize some network service processes. See the relevant script file specific to see. 2, is it to install after the version is recompiled? I want to install Oracle8i in RH6.2, follow the instructions that need to modify the value of shared memory and segments in the system kernel, and do not upgrade the kernel. Specifically modify the value of SHMMAX, SHMMMNI, SHMSEG in Shmparam.h and the value of SEMMSL, SEGMNS, SEMOPM in Sem.h. Make MrProper is normal during recompilation; running make config, there are many prompts, all press the Enter key to use the default value; make Dep, make Clean, make Bzimage is more normal. Then copy BZIMAGE to the / boot directory, modify the contents of the /etc/lilo.conf file, make image = / boot / bzimage-2.2.14, then run Lilo, restart. After the startup prompts two errors, one is Ethernet error, and the network cannot be used after entering Linux. Please ask the kernel experts: 1. What is wrong? 2. I have not upgraded the kernel, only modify some of the parameters, can I do not do the whole process? 3. How to know that the system has already run in a new SHMMAX equivalent. Before compiling the kernel, dry when configured? Use make config, you can use Make MenuConfig or make XConfig to select the NIC driver. 3, a problem with compiling 8390.c How to compile 8390.c and ne.c drivers with GCC. Try GCC -O3 -Wall -DModule -d__kernel__ -dlinux -c 8309.c (ne.c) Redhat7.o market reflection is very bad, there are many problems, not suitable for programming, recommendation 6.2, or version 7.1.

4, LKM programs compiled by LKM programming problems can be compiled under the red flag Linux, but when the Turbo Linux compiles the header file error. I don't know what the reason, how to deal with. Which version of the core, 2.2 The latter kernel should replace MEMCPY_FROMFS 5, and SK_BUFF which heroes know which correspondence is calculated and written in SK_BUFF, thank you. /usr/src/linux/net/IPv4/udp.c: UDP_CHECK (....) Call CSUM_TCPUDP_MAGIC Calculate Check: You can view /usr/src/linux/include/ASM-i386/checksum.h View The specific algorithm CSUM is a one four of Check Sum. Writing SK_BUFF is done in UDP_RCV (....).

6. Compiling the Loading kernel module on blue dot Linux 2.2.13, the original program is as follows: / * Hello.c * / # define module #define __kernel__ #include #include #Include #include #include #include #include #include #include #include #include #include #include extern void * sys_call_table []; int (* orig_open) (const char * pathname, int flag, mode_t mode); int my_open (const char * pathname, int flag, mode_t mode) {char * kernel_pathname; char hide [] = " ourtool "; / * converted into kernel space * / kernel_pathname = (char *) kmalloc (256, GFP_KERNEL); memcpy_fromfs (kernel_pathname, pathname, 255); if (! strstr (kernel_pathname, (char *) & hide) = NULL) { Kfree (kernel_pathname); / * Return error code, 'file dos not exist' * / return -enoent;} else {kfree (kernel_pathname); / * Everything OK, this is not our tool * / return orig_open (Pathname, Flag, Mode);}}} int init_module (void) / * initialization module * / {orig_open = sys_call_table [SYS_OP EN]; SYS_CALL_TABLE [SYS_OPEN] = my_open; return 0;} void cleanup_module (void) / * Uninstall module * / {sys_call_table [sys_open] = orig_open;} / * end of hello.c * / I use superuser as the following command Compile: gcc -c -o3 hello.c Compile is unsuccessful, prompted as follows: in file incudded from /usr/include/linux/Affs_fs_i.h:5, from /us.h:270, From Hello.c: 14: /usr/include/linux/time.h: 69: Warning: `fd_set 'redefined / usr / include / sys / selection.h: 63: warning: this is the location of the previous definition / USR / include / Linux / Time.h: 70: Warning: `fd_clr '

Redefined / usr / include / Sys / SELECT.H: 64: Warning: this is the location of the previous definition / usr / include / linux / time.h: 71: warning: `fd_isset 'redined / usr / include / sys / SELECT.H: 65: WARNING: this is the location of the previous definition / usr / include / linux / time.h: 72: warning: `fd_zero 'redefined / usr / include / sys / selection.h: 66: warning: This is the location of the prep /usr/include/linux/Affs_fs_i.h: 5, from /usr/include/linux/fs.h:270, from hello.c: 14: / usr / include / Linux / Time.h: 9: Redefinition of `Struct Timespec '/ usr / include / Linux / Time.h: 51: Parse Error Before` suseconds_t' / usr / include / Linux / Time.h: 51: Warning: No Semicolon At end of struct or union / usr / include / linux / time.h: 88: Field `IT_Interval 'Has Incomplete Type / USR / include / Linux / Time.h: 89: Field` IT_Value' Has Incomplete Typein File Included from / USR / include / linux / fs.h: 270, from helpe/linux/Affs_fs_i.h: 11: Field `KC_LRU_TIME 'HAS INCOMPLETE TYPEIN FILINUX/FS.H: 272, from Hello.c: 14: /usr/include/linux/efs_fs_i.h: 13: Parse Error Before `EFS_INO_T '/ USR / INCLUDE / Linux /EFS_FS_I.H :13: WARNING: DATA Definition Has No Type or Storage Class / USR / INCLUDE / Linux / EFS_FS_I.H: 49: Parse Error Before `uint32_t '/ usr / include / linux / EFS_FS_I.H: 49: Warning : No Semicolon At End of Struct Or Union / USR / include / Linux / EFS_FS_I.H: 57: PARSE ERROR BEFORE `} 'in file incudded from /usr/include/linux/coda_fs_i.h:14, from / usr / include /Linux/fs.h:273, from hello.c: 14: /usr/include/linux/coda.h: 109: Warning: Redefinition of `u_quad_t '

/usr/include/sys/types.h:38: Warning: `u_quad_t 'previously declared herein file include from /usr/include/linux/sched.h:13, from /usr/include/linux/mm.h: 4 , From /usr/include/linux/slab.h:14, from usr/include/linux/malloc.h:4, from hello.c: 15: /usr/include/linux/times.h: 5: Parse Error Before `Clock_t '/ usr / include / linux / times.h: 5: Warning: No semicolon at end of struct or union / usr / include / linux / times.h: 6: Warning: data definition Has no type or storage Class / usr / include / Linux / Times.h: 7: Parse Error Before `TMS_CUTIME '/ USR / INCLUDE / Linux / Times.h: 7: Warning: Data Definition Has No Type or Storage Class / USR / INCLUDE / Linux / Times.h: 8: Parse Error Before `TMS_CSTIME '/ USR / INCLUDE / Linux / Times.h: 8: Warning: Data Definition Has No Type or Storage Classin File Included from /usr/include/linux/sched.h:14 , From /usr/include/linux/mm.h:4, from /usr/include/linux/slab.h:14, from / usr / include /Linux/malloc.h:4, from hello.c: 15: /usr/include/linux/timex.h: 159: Field `Time 'Has INCLETE TYPEIN FILE Included from /usr/include/linux/signal.h: 5, from /usr/include/linux/sched.h:23, from /usr/include/linux/mm.h:4, from /usr/include/linux/slab.h: 14, from / usr / include / Linux / malloc.h: 4, from helpo.c: 15: /usr/include/asm/siginfo.h: 48: Parse Error Before `Clock_t '

/usr/inco.h:48: Warning: No Semicolon At end of struct or union / usr / include / asm / siginfo.h: 48: warning: no semicolon at end of struct or union / usr / incrude / SIONFO.H: 49: WARNING: NO SEMICOLON at End of struct or union / usr / include / asm / siginfo.h: 50: warning: data definition Has no type or storage class / usr / include / asm / siginfo .h: 62: Parse Error Before `} '/ usr / include / asm / siginfo.h: 62: Warning: Data Definition Has No Type or Storage Class / USR / include / ask / SIGINFO.H: 63: Parse Error Before `} '/ usr / include: 63: warning: data definition Has no type or storage classin file incrhem /usr/include/linux/sched.h:23, from / usr / include / linux / Mm.h: 4, from /usr/include/linux/slab.h:14, from /usr/include/linux/malloc.h: 4, from hello.c: 15: / usr / include / linux / signal. H: 15: Parse Error Before `SigInfo_t '/ usr / include / linux / signal.h: 15: Warning: No Semicolon At end of struct or unionin file incrom / usr / incl Ude / Linux / Sched.h: 71, from /usr/include/linux/mm.h:4, from /usr/include/linux/slab.h:14, from /usr/include/linux/malloc.h: 4, from hello.c: 15: /usr/include/linux/resource.h: 22: Field `Ru_utime 'Has INCOMPLETE TYPE / USR / INCLUDE / Linux / Resource.h: 23: Field` Ru_stime' Has Incomplete Typein File Included from /usr/include/linux/mm.h: 4, from /usr/include/linux/slab.h:14, from /usr/include/linux/malloc.h:4, from hello.c: 15: /usr/include/linux/sched.h:288: Field `Times'

转载请注明原文地址:https://www.9cbs.com/read-3486.html

New Post(0)