start_kernel() 안에 rest_init() 안에서 init 함수를 kernel_th
start_kernel() 안에 rest_init() 안에서 init 함수를 kernel_thread 로 등록 하기 전에
커널 쓰레드로 어떤 스레드를 실행시키면
1개이상 안되는 이유는 무엇인가요?
실험을 해봤는데 2개가 한계더군요.
Inode-cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
CPU: Intel Pentium III (Coppermine) stepping 03
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
Checking for popad bug... OK.
POSIX conformance testing by UNIFIX
Kernelthread returns 1@thread1
bios32_service(0x49435024): not present
PCI: System does not support PCI
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Alex! I'm here! init/main.c, line : 637
Starting kswapd
block: 64 slots per queue, batch=8
Floppy drive(s): fd0 is 1.44M
FDC 0 is an 8272A
Out of While!
Out of flush_scheduled_tasks()
(Warning, this kernel has no ramdisk support)
VFS: Insert root floppy and press ENTER
이렇게 되어있고 제가 수정한 소스코드는 다음과 같습니다.
static void rest_init(void)
{
//init(NULL);
printk("Kernelthread returns %d@thread1\n",kernel_thread(thread1,NULL,CLONE_FS|CLONE_FILES|CLONE_SIGNAL));
kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
printk("Kernelthread returns %d@thread2\n",kernel_thread(thread2,NULL,CLONE_FS|CLONE_FILES|CLONE_SIGNAL));
printk("Kernelthread returns %d@thread3\n",kernel_thread(thread3,NULL,CLONE_FS|CLONE_FILES|CLONE_SIGNAL));
unlock_kernel();
current->need_resched = 1;
cpu_idle();
}
[/b]
댓글 달기