This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://git.busybox.net/busybox | |
| cd busybox | |
| git checkout 1_32_1 | |
| make defconfig | |
| make menuconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dd if=/dev/zero of=root.bin bs=1M count=64 | |
| mkfs.ext2 -F root.bin | |
| mkdir mnt | |
| sudo mount -o loop root.bin mnt | |
| cd mnt | |
| sudo mkdir -p bin etc dev lib proc sbin tmp usr usr/bin usr/lib usr/sbin | |
| sudo cp ~/busybox/busybox bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| /* | |
| * Copyright (C) 2012 Regents of the University of California | |
| * Copyright (C) 2017 SiFive | |
| */ | |
| #define LOAD_OFFSET PAGE_OFFSET | |
| #include <asm/vmlinux.lds.h> | |
| #include <asm/page.h> | |
| #include <asm/cache.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OUTPUT_ARCH(riscv) | |
| ENTRY(_start) | |
| jiffies = jiffies_64; | |
| SECTIONS | |
| { | |
| . = 0xffffffe000000000; | |
| _start = .; | |
| __init_begin = .; | |
| .head.text : AT(ADDR(.head.text) - 0xffffffe000000000) { KEEP(*(.head.text)) } | |
| . = ALIGN((1 << (12))); .init.text : AT(ADDR(.init.text) - 0xffffffe000000000) { _sinittext = .; *(.init.text .init.text.*) *(.text.startup) *(.meminit.text*) _einittext = .; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Helper macros to support writing architecture specific | |
| * linker scripts. | |
| * | |
| * A minimal linker scripts has following content: | |
| * [This is a sample, architectures may have special requiriements] | |
| * | |
| * OUTPUT_FORMAT(...) | |
| * OUTPUT_ARCH(...) | |
| * ENTRY(...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| /* | |
| * Copyright (C) 2017 Chen Liqin <liqin.chen@sunplusct.com> | |
| * Copyright (C) 2012 Regents of the University of California | |
| */ | |
| #ifndef _ASM_RISCV_CACHE_H | |
| #define _ASM_RISCV_CACHE_H | |
| #define L1_CACHE_SHIFT 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| /* | |
| * Copyright (C) 2009 Chen Liqin <liqin.chen@sunplusct.com> | |
| * Copyright (C) 2012 Regents of the University of California | |
| * Copyright (C) 2017 SiFive | |
| * Copyright (C) 2017 XiaojingZhu <zhuxiaoj@ict.ac.cn> | |
| */ | |
| #ifndef _ASM_RISCV_PAGE_H | |
| #define _ASM_RISCV_PAGE_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| /* | |
| * Copyright (C) 2009 Chen Liqin <liqin.chen@sunplusct.com> | |
| * Copyright (C) 2012 Regents of the University of California | |
| * Copyright (C) 2017 SiFive | |
| */ | |
| #ifndef _ASM_RISCV_THREAD_INFO_H | |
| #define _ASM_RISCV_THREAD_INFO_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Helper macros to support writing architecture specific | |
| * linker scripts. | |
| * | |
| * A minimal linker scripts has following content: | |
| * [This is a sample, architectures may have special requiriements] | |
| */ | |
| OUTPUT_FORMAT(...) | |
| OUTPUT_ARCH(...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Rmap Study in Linux Kernel v5.1 | |
| * | |
| * [kernel/fork.c -> rmap.c] rmap init routine. | |
| * | |
| * do_fork [kernel/fork.c] | |
| * - _do_fork [kernel/fork.c] | |
| * -- copy_process [kernel/fork.c] | |
| * --- copy_mm [kernel/fork.c] | |
| * |