Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/boot/Documentation: Fix whitespace noise in boot.rst

There's a lot of unnecessary whitespace damage in this
file: space before tabs, etc., that has no formatting
or readability effect or advantages.

Fix them.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/176535283007.498.16442167388418039352.tip-bot2@tip-bot2

+94 -94
+94 -94
Documentation/arch/x86/boot.rst
··· 95 95 The traditional memory map for the kernel loader, used for Image or 96 96 zImage kernels, typically looks like:: 97 97 98 - | | 98 + | | 99 99 0A0000 +------------------------+ 100 - | Reserved for BIOS | Do not use. Reserved for BIOS EBDA. 100 + | Reserved for BIOS | Do not use. Reserved for BIOS EBDA. 101 101 09A000 +------------------------+ 102 - | Command line | 103 - | Stack/heap | For use by the kernel real-mode code. 102 + | Command line | 103 + | Stack/heap | For use by the kernel real-mode code. 104 104 098000 +------------------------+ 105 - | Kernel setup | The kernel real-mode code. 105 + | Kernel setup | The kernel real-mode code. 106 106 090200 +------------------------+ 107 - | Kernel boot sector | The kernel legacy boot sector. 107 + | Kernel boot sector | The kernel legacy boot sector. 108 108 090000 +------------------------+ 109 - | Protected-mode kernel | The bulk of the kernel image. 109 + | Protected-mode kernel | The bulk of the kernel image. 110 110 010000 +------------------------+ 111 - | Boot loader | <- Boot sector entry point 0000:7C00 111 + | Boot loader | <- Boot sector entry point 0000:7C00 112 112 001000 +------------------------+ 113 - | Reserved for MBR/BIOS | 113 + | Reserved for MBR/BIOS | 114 114 000800 +------------------------+ 115 - | Typically used by MBR | 115 + | Typically used by MBR | 116 116 000600 +------------------------+ 117 - | BIOS use only | 117 + | BIOS use only | 118 118 000000 +------------------------+ 119 119 120 120 When using bzImage, the protected-mode kernel was relocated to ··· 142 142 For a modern bzImage kernel with boot protocol version >= 2.02, a 143 143 memory layout like the following is suggested:: 144 144 145 - ~ ~ 146 - | Protected-mode kernel | 145 + ~ ~ 146 + | Protected-mode kernel | 147 147 100000 +------------------------+ 148 - | I/O memory hole | 148 + | I/O memory hole | 149 149 0A0000 +------------------------+ 150 - | Reserved for BIOS | Leave as much as possible unused 151 - ~ ~ 152 - | Command line | (Can also be below the X+10000 mark) 150 + | Reserved for BIOS | Leave as much as possible unused 151 + ~ ~ 152 + | Command line | (Can also be below the X+10000 mark) 153 153 X+10000 +------------------------+ 154 - | Stack/heap | For use by the kernel real-mode code. 154 + | Stack/heap | For use by the kernel real-mode code. 155 155 X+08000 +------------------------+ 156 - | Kernel setup | The kernel real-mode code. 157 - | Kernel boot sector | The kernel legacy boot sector. 156 + | Kernel setup | The kernel real-mode code. 157 + | Kernel boot sector | The kernel legacy boot sector. 158 158 X +------------------------+ 159 - | Boot loader | <- Boot sector entry point 0000:7C00 159 + | Boot loader | <- Boot sector entry point 0000:7C00 160 160 001000 +------------------------+ 161 - | Reserved for MBR/BIOS | 161 + | Reserved for MBR/BIOS | 162 162 000800 +------------------------+ 163 - | Typically used by MBR | 163 + | Typically used by MBR | 164 164 000600 +------------------------+ 165 - | BIOS use only | 165 + | BIOS use only | 166 166 000000 +------------------------+ 167 167 168 168 ... where the address X is as low as the design of the boot loader permits. ··· 809 809 as follow:: 810 810 811 811 struct setup_data { 812 - __u64 next; 813 - __u32 type; 814 - __u32 len; 815 - __u8 data[]; 812 + __u64 next; 813 + __u32 type; 814 + __u32 len; 815 + __u8 data[]; 816 816 } 817 - 817 + 818 818 Where, the next is a 64-bit physical pointer to the next node of 819 819 linked list, the next field of the last node is 0; the type is used 820 820 to identify the contents of data; the len is the length of data ··· 835 835 protocol 2.15:: 836 836 837 837 struct setup_indirect { 838 - __u32 type; 839 - __u32 reserved; /* Reserved, must be set to zero. */ 840 - __u64 len; 841 - __u64 addr; 838 + __u32 type; 839 + __u32 reserved; /* Reserved, must be set to zero. */ 840 + __u64 len; 841 + __u64 addr; 842 842 }; 843 843 844 844 The type member is a SETUP_INDIRECT | SETUP_* type. However, it cannot be ··· 850 850 In this case setup_data and setup_indirect will look like this:: 851 851 852 852 struct setup_data { 853 - .next = 0, /* or <addr_of_next_setup_data_struct> */ 854 - .type = SETUP_INDIRECT, 855 - .len = sizeof(setup_indirect), 856 - .data[sizeof(setup_indirect)] = (struct setup_indirect) { 857 - .type = SETUP_INDIRECT | SETUP_E820_EXT, 858 - .reserved = 0, 859 - .len = <len_of_SETUP_E820_EXT_data>, 860 - .addr = <addr_of_SETUP_E820_EXT_data>, 861 - }, 853 + .next = 0, /* or <addr_of_next_setup_data_struct> */ 854 + .type = SETUP_INDIRECT, 855 + .len = sizeof(setup_indirect), 856 + .data[sizeof(setup_indirect)] = (struct setup_indirect) { 857 + .type = SETUP_INDIRECT | SETUP_E820_EXT, 858 + .reserved = 0, 859 + .len = <len_of_SETUP_E820_EXT_data>, 860 + .addr = <addr_of_SETUP_E820_EXT_data>, 861 + }, 862 862 } 863 863 864 864 .. note:: ··· 897 897 The kernel runtime start address is determined by the following algorithm:: 898 898 899 899 if (relocatable_kernel) { 900 - if (load_address < pref_address) 901 - load_address = pref_address; 902 - runtime_start = align_up(load_address, kernel_alignment); 900 + if (load_address < pref_address) 901 + load_address = pref_address; 902 + runtime_start = align_up(load_address, kernel_alignment); 903 903 } else { 904 - runtime_start = pref_address; 904 + runtime_start = pref_address; 905 905 } 906 906 907 907 Hence the necessary memory window location and size can be estimated by ··· 975 975 be prefixed with header/magic and its size, e.g.:: 976 976 977 977 kernel_info: 978 - .ascii "LToP" /* Header, Linux top (structure). */ 979 - .long kernel_info_var_len_data - kernel_info 980 - .long kernel_info_end - kernel_info 981 - .long 0x01234567 /* Some fixed size data for the bootloaders. */ 978 + .ascii "LToP" /* Header, Linux top (structure). */ 979 + .long kernel_info_var_len_data - kernel_info 980 + .long kernel_info_end - kernel_info 981 + .long 0x01234567 /* Some fixed size data for the bootloaders. */ 982 982 kernel_info_var_len_data: 983 983 example_struct: /* Some variable size data for the bootloaders. */ 984 - .ascii "0123" /* Header/Magic. */ 985 - .long example_struct_end - example_struct 986 - .ascii "Struct" 987 - .long 0x89012345 984 + .ascii "0123" /* Header/Magic. */ 985 + .long example_struct_end - example_struct 986 + .ascii "Struct" 987 + .long 0x89012345 988 988 example_struct_end: 989 989 example_strings: /* Some variable size data for the bootloaders. */ 990 - .ascii "ABCD" /* Header/Magic. */ 991 - .long example_strings_end - example_strings 992 - .asciz "String_0" 993 - .asciz "String_1" 990 + .ascii "ABCD" /* Header/Magic. */ 991 + .long example_strings_end - example_strings 992 + .asciz "String_0" 993 + .asciz "String_1" 994 994 example_strings_end: 995 995 kernel_info_end: 996 996 ··· 1132 1132 unsigned long base_ptr; /* base address for real-mode segment */ 1133 1133 1134 1134 if (setup_sects == 0) 1135 - setup_sects = 4; 1135 + setup_sects = 4; 1136 1136 1137 1137 if (protocol >= 0x0200) { 1138 - type_of_loader = <type code>; 1139 - if (loading_initrd) { 1140 - ramdisk_image = <initrd_address>; 1141 - ramdisk_size = <initrd_size>; 1142 - } 1138 + type_of_loader = <type code>; 1139 + if (loading_initrd) { 1140 + ramdisk_image = <initrd_address>; 1141 + ramdisk_size = <initrd_size>; 1142 + } 1143 1143 1144 - if (protocol >= 0x0202 && loadflags & 0x01) 1145 - heap_end = 0xe000; 1146 - else 1147 - heap_end = 0x9800; 1144 + if (protocol >= 0x0202 && loadflags & 0x01) 1145 + heap_end = 0xe000; 1146 + else 1147 + heap_end = 0x9800; 1148 1148 1149 - if (protocol >= 0x0201) { 1150 - heap_end_ptr = heap_end - 0x200; 1151 - loadflags |= 0x80; /* CAN_USE_HEAP */ 1152 - } 1149 + if (protocol >= 0x0201) { 1150 + heap_end_ptr = heap_end - 0x200; 1151 + loadflags |= 0x80; /* CAN_USE_HEAP */ 1152 + } 1153 1153 1154 - if (protocol >= 0x0202) { 1155 - cmd_line_ptr = base_ptr + heap_end; 1156 - strcpy(cmd_line_ptr, cmdline); 1157 - } else { 1158 - cmd_line_magic = 0xA33F; 1159 - cmd_line_offset = heap_end; 1160 - setup_move_size = heap_end + strlen(cmdline) + 1; 1161 - strcpy(base_ptr + cmd_line_offset, cmdline); 1162 - } 1154 + if (protocol >= 0x0202) { 1155 + cmd_line_ptr = base_ptr + heap_end; 1156 + strcpy(cmd_line_ptr, cmdline); 1157 + } else { 1158 + cmd_line_magic = 0xA33F; 1159 + cmd_line_offset = heap_end; 1160 + setup_move_size = heap_end + strlen(cmdline) + 1; 1161 + strcpy(base_ptr + cmd_line_offset, cmdline); 1162 + } 1163 1163 } else { 1164 - /* Very old kernel */ 1164 + /* Very old kernel */ 1165 1165 1166 - heap_end = 0x9800; 1166 + heap_end = 0x9800; 1167 1167 1168 - cmd_line_magic = 0xA33F; 1169 - cmd_line_offset = heap_end; 1168 + cmd_line_magic = 0xA33F; 1169 + cmd_line_offset = heap_end; 1170 1170 1171 - /* A very old kernel MUST have its real-mode code loaded at 0x90000 */ 1172 - if (base_ptr != 0x90000) { 1173 - /* Copy the real-mode kernel */ 1174 - memcpy(0x90000, base_ptr, (setup_sects + 1) * 512); 1175 - base_ptr = 0x90000; /* Relocated */ 1176 - } 1171 + /* A very old kernel MUST have its real-mode code loaded at 0x90000 */ 1172 + if (base_ptr != 0x90000) { 1173 + /* Copy the real-mode kernel */ 1174 + memcpy(0x90000, base_ptr, (setup_sects + 1) * 512); 1175 + base_ptr = 0x90000; /* Relocated */ 1176 + } 1177 1177 1178 - strcpy(0x90000 + cmd_line_offset, cmdline); 1178 + strcpy(0x90000 + cmd_line_offset, cmdline); 1179 1179 1180 - /* It is recommended to clear memory up to the 32K mark */ 1181 - memset(0x90000 + (setup_sects + 1) * 512, 0, (64 - (setup_sects + 1)) * 512); 1180 + /* It is recommended to clear memory up to the 32K mark */ 1181 + memset(0x90000 + (setup_sects + 1) * 512, 0, (64 - (setup_sects + 1)) * 512); 1182 1182 } 1183 1183 1184 1184