2. start_kernel()

커널 v4.0 코드 분석 내용을 커널 v5.0 코드로 계속하여 변경하고 있습니다.

커널 v4.0 기준

lockdep_init()
set_task_stack_end_magic()
smp_setup_processor_id()
debug_objects_early_init()
boot_init_stack_canary()
cgroup_init_early()
local_irq_disable()
boot_cpu_init()
page_address_init()

setup_arch() – for ARM32
setup_processor()
setup_machine_fdt() or
setup_machine_tags()
parse_early_param()
early_paging_init()
setup_dma_zone()
sanity_check_meminfo()
arm_memblock_init()
paging_init()
——build_mem_type_table()
——prepare_page_table()
——map_lowmem()
——dma_contiguous_remap()
——devicemaps_init()
——kmap_init()
——tcm_init()
——bootmem_init()
——__flush_dcache_page()
request_standard_resources()
unflatten_device_tree()
arm_dt_init_cpu_maps()
psci_init()
smp_init_cpus()
smp_build_mpidr_hash()
hyp_mode_check()
reserve_crashkernel()
mdesc->init_early()

mm_init_cpumask()
setup_command_line()
setup_nr_cpu_ids()
setup_per_cpu_areas()
smp_prepare_boot_cpu()
build_all_zonelists()
page_alloc_init()
parse_early_param()
parse_args()
jump_label_init()
setup_log_buf()
pidhash_init()
vfs_caches_init_early()
sort_main_extable()
mm_init()
page_ext_init_flatmem()
mem_init()
kmem_cache_init()
percpu_init_late()
pgtable_init()
vmalloc_init()
sched_init()
idr_init_cache()
rcu_init()
trace_init()
context_tracking_init()
radix_tree_init()
early_irq_init()
init_IRQ()
tick_init()
rcu_init_nohz()
init_timers()
hrtimers_init()
softirq_init()
timekeeping_init()
time_init()
sched_clock_postinit()
perf_event_init()
profile_init()
call_function_init()
console_init()
lockdep_info()
locking_selftest()
page_ext_init()
debug_objects_mem_init()
kmemleak_init()
setup_per_cpu_pageset()
numa_policy_init()
sched_clock_init()
calibrate_delay()
pidmap_init()
anon_vma_init()
acpi_early_init()
thread_info_cache_init()
cred_init()
fork_init()
proc_caches_init()
buffer_init()
key_init()
security_init()
dbg_late_init()
vfs_caches_init()
signals_init()
page_writeback_init()
proc_root_init()
nsfs_init()
cgroup_init()
cpuset_init()
taskstats_init_early()
delayacct_init()
check_bugs()
sfi_init_late()
efi_late_init()
efi_free_boot_services()
ftrace_init()
rest_init()
numa_default_policy()
kernel_thread()
cpu_startup_entry()

커널 v5.0 기준

set_task_stack_end_magic()
smp_setup_processor_id()
debug_objects_early_init()
cgroup_init_early()
local_irq_disable()
boot_cpu_init()
page_address_init()

setup_arch()for ARM64
early_fixmap_init()
early_ioremap_init()
setup_machine_fdt()
parse_early_param()
—local_daif_restore()
cpu_uninstall_idmap()
—xen_early_init()
—efi_init()
arm64_memblock_init()
paging_init()
——map_kernel()
——map_mem()
——cpu_replace_ttbr1()
——memblock_allow_resize()
—acpi_table_upgrade()
—acpi_boot_table_init()
unflatten_device_tree()
bootmem_init()
—kasan_init()
request_standard_resources()
early_ioremap_reset()
psci_dt_init() or
—psci_acpi_init()
cpu_read_bootcpu_ops()
smp_init_cpus()
smp_build_mpidr_hash()
—kasan_init_tags()
add_latent_entropy()
add_device_randomness()
boot_init_stack_canary()
mm_init_cpumask()
setup_command_line()
setup_nr_cpu_ids()
setup_per_cpu_areas()
smp_prepare_boot_cpu()
boot_cpu_hotplug_init()
build_all_zonelists()
page_alloc_init()
parse_early_param()
parse_args()
jump_label_init()
setup_log_buf()
vfs_caches_init_early()
sort_main_extable()
trap_init()
mm_init()
——page_ext_init_flatmem()
——mem_init()
——kmem_cache_init()
——pgtable_init()
——vmalloc_init()
——ioremap_huge_init()
——init_espfix_bsp()
——pti_init()
ftrace_init()
early_trace_init()
sched_init()
preempt_disable()
radix_tree_init()
housekeeping_init()
workqueue_init_early()
rcu_init()
trace_init()
initcall_debug_enable()
context_tracking_init()
early_irq_init()
init_IRQ()
tick_init()
rcu_init_nohz()
init_timers()
hrtimers_init()
softirq_init()
timekeeping_init()
time_init()
printk_safe_init()
perf_event_init()
profile_init()
call_function_init()
local_irq_enable()
kmem_cache_init_late()
console_init()
lockdep_init()
locking_selftest()
mem_encrypt_init()
kmemleak_init()
setup_per_cpu_pageset()
numa_policy_init()
acpi_early_init()
late_time_init()
sched_clock_init()
calibrate_delay()
pid_idr_init()
anon_vma_init()
efi_enter_virtual_mode()
thread_stack_cache_init()
cred_init()
fork_init()
proc_caches_init()
uts_ns_init()
buffer_init()
key_init()
security_init()
dbg_late_init()
vfs_caches_init()
pagecache_init()
signals_init()
seq_file_init()
proc_root_init()
nsfs_init()
cpuset_init()
cgroup_init()
taskstats_init_early()
delayacct_init()
check_bugs()
acpi_subsystem_init()
arch_post_acpi_subsys_init()
sfi_init_late()
arch_call_rest_init()
—rest_init()
——rcu_scheduler_starting()
——kernel_thread()
——numa_default_policy()
——cpu_startup_entry()

.

kernel_init() 스레드

kernel_init_freeable()
wait_for_completion()
set_mems_allowed()
—set_cpus_allowed_ptr()
—smp_prepare_cpus()
—do_pre_smp_initcalls()
—lockup_detector_init()
—smp_init()
—sched_init_smp()
—do_basic_setup()
——cpuset_init_smp()
——usermodehelper_init()
——shmem_init()
——driver_init()
——init_irq_proc()
——do_ctors()
——usermodehelper_enable()
——do_initcalls()
——random_int_secret_init()
—sys_open()
—sys_access()
—prepare_namespace()
——wait_for_device_probe()
——md_run_setup()
——mount_block_root()
——initrd_load()
——async_synchronize_full()
——rd_load_disk()
——mount_root()
——devtmpfs_mount()
——sys_mount()
——sys_chroot()
—integrity_load_keys()
—load_default_modules()
async_synchronize_full()
free_initmem()
mark_rodata_ro()
flush_delayed_fput()
run_init_process()
try_to_run_init_process()

kernel_init() 스레드

kernel_init_freeable()
—wait_for_completion()
—set_mems_allowed()
—set_cpus_allowed_ptr()
—smp_prepare_cpus()
—workqueue_init()
—init_mm_internals()
—do_pre_smp_initcalls()
—lockup_detector_init()
—smp_init()
—sched_init_smp()
—page_alloc_init_late()
—page_ext_init()
—do_basic_setup()
——cpuset_init_smp()
——shmem_init()
——driver_init()
——init_irq_proc()
——do_ctors()
——usermodehelper_enable()
——do_initcalls()
—ksys_open()
—ksys_dup()
—ksys_access()
—prepare_namespace()
——wait_for_device_probe()
——md_run_setup()
——mount_block_root()
——initrd_load()
——async_synchronize_full()
——rd_load_disk()
——mount_root()
——devtmpfs_mount()
——ksys_mount()
——ksys_chroot()
—integrity_load_keys()
async_synchronize_full()
ftrace_free_init_mem()
free_initmem()
mark_readonly()
pti_finalize()
numa_default_policy()
rcu_end_inkernel_boot()
run_init_process()

.