Listing 1. System Initialization

# Set the GDT size to its maximum value 8192
# in head.S
# In the definition of GDT in file desc.h, insert
# entries reserved for each CPU and reserve all
# other entries for processes, as original
# system does.
CPU0: SHARED_TSS_ENTRY = 12
SHARED_LDT_ENTRY = 13
CPU1: SHARED_TSS_ENTRY + 1 = 14
SHARED_LDT_ENTRY + 1 = 15
...
CPUn: SHARED_TSS_ENTRY + n = SHARED_TSS_ENTRY + n
SHARED_LDT_ENTRY + n = SHARED_LDT_ENTRY + n
( n < NR_CPUS )
# Change NR_TASKS from a macro to a variable, and
# doing this in system initialize function
# start_kernel():
Task = kmalloc(sizeof(void *) * NR_TASKS,
   GFP_ATOMIC);
# This will dynamically allocate the process
# list array.
# Modify the parse_options function to accept an
# extra parameter nrtasks, which indicates the
# maximum concurrent process number. This will
# enable the user to dynamically set maximum
# process number.