bootloader

让Grub 2来拯救你的 bootloader

别等时光非礼了梦想. 提交于 2019-12-07 19:58:49
没有什么事情比 bootloader 坏掉更气人的了,充分发挥 Grub 2 的作用,让 bootloader 安分工作吧。为什么这么说? Grub 2 是最受欢迎的 bootloader ,几乎用在所有 Linux 发行版上。 bootloader 是一个至关重要的软件,但是非常容易损坏。 Grub 2 是兼具扩展性和灵活性的一款引导加载程序,提供了大量可定制选项。 Grub 2 是一款功能强大的软件,它不是 bootloader 界的唯一,但却最受欢迎,几乎所有主流的桌面发行版都在使用它。 Grub 的工作有两个:首先,它用一个菜单展示计算机上所有已经安装的操作系统供你选择;其次,当你从启动菜单中选择了一个 Linux 操作系统后, Grub 便加载对应版本Linux 的内核,众所周知,使用 Linux 就离不开 bootloader ,然而它却是 Linux 发行版内部很少有人充分了解的部分。 1、Grub 2 最重要的部分是一堆文本文件和两个脚本文件,首先需要了解的是 /etc/default/grub ,这是一个文本文件,你可以在里面设置通用配置变量和 Grub 2 菜单(见下方 “常见用户设置” )的其它特性。 2、Grub 2 另一个重要的部分是 /etc/grub.d 文件夹,定义每个菜单项的所有脚本都放置在这里,这些脚本的名称必须有两位的数字前缀,其目的是:在构建

Triple fault when jumping into protected mode

别说谁变了你拦得住时间么 提交于 2019-12-07 11:19:22
问题 I'm developing a boot loader, which will boot into a simple kernel after switching into protected mode. I used this paper as a tutorial, somewhere in chapter four or five. In theory it is supposed to start in 16-bit real mode, load the kernel into memory, switch to 32-bit protected mode and start executing the kernel code. However, when I switch into protected mode and far jump or jump to another segment, it triple faults. Here is the main boot sector code: [org 0x7c00] KERNEL_OFFSET equ

How can I JMP to relocated code in my MBR?

喜欢而已 提交于 2019-12-07 09:38:32
问题 I'm trying to write an extremely simple MBR to start learning how to write an MBR/Kernel. This is what I have so far (created from pieces of other MBRs). The binary I get from using nasm and then ld to link is a bit different from just using nasm for both, but that doesn't appear to be the problem. I first started with jmp 0:continue but that appears to jump to 0000:7c22 (or 001d with nasm alone... i believe i didnt specify that it starts at 7c00 ) but im looking to jump to :7a22 or :7a1d ,

Using db to declare a string in assembly NASM

橙三吉。 提交于 2019-12-07 06:28:37
问题 I am following a tutorial to write a hello world bootloader in assembly and I am using the NASM assembler for an x-86 machine. This is the code I am using : [BITS 16] ;Tells the assembler that its a 16 bit code [ORG 0x7C00] ;Origin, tell the assembler that where the code will ;be in memory after it is been loaded MOV SI, HelloString ;Store string pointer to SI CALL PrintString ;Call print string procedure JMP $ ;Infinite loop, hang it here. PrintCharacter: ;Procedure to print character on

How to handle keyboard in real mode through BIOS interrupts?

混江龙づ霸主 提交于 2019-12-07 02:54:57
问题 I have to code for a operating system on which I can run a calculater.It is like a desktop calculater. For this I am reading the brokenthorn operating development series I have completed the second stage of bootloader The bootloader is in real mode. After this the author is explaining the protected mode. I don't want to use the protected mode. I don't have time for that. So I want to write the calculater in real mode by using bios interrupts. Is it possible? I think it can be written on the

Working FAT16 Bootloader Generates Read Error on Actual Hardware?

天大地大妈咪最大 提交于 2019-12-07 02:48:29
问题 For about the past week, I've been developing a simple OS for learning purposes and... "fun". VirtualBox and NASM in tow, I actually got off to a pretty good start. Eventually, I decided that I wanted to also develop a bootloader (after hitting the 512-byte wall pretty hard) by powering through the infamous Brokenthorn tutorial, up until the point of loading from filesystems. With some HexFiend shenanigans and some blank FAT16 images, I eventually got the BPB worked out. With some additional

UEFI BootLoader

北慕城南 提交于 2019-12-06 09:58:53
问题 I am looking at developing a simple (to start with) UEFI Boot loader to load a ELF image, and was wondering if anyone had a good entry point into maybe any existing projects, or examples that I can use to get started out with. In addition I was wondering if any one had any experience in getting virtual box to run an EFI application. I have set up a VM with EFI mother board but can seam to create an EFI System Partition for it to load out of (without using an OS), all I can achieve is the UEFI

Understanding of boot loader assembly code and memory locations

ⅰ亾dé卋堺 提交于 2019-12-06 07:37:45
I want to check my understanding of the following bootloader code: BITS 16 start: mov ax, 07C0h ; Set up 4K stack space after this bootloader add ax, 288 ; (4096 + 512) / 16 bytes per paragraph mov ss, ax mov sp, 4096 mov ax, 07C0h ; Set data segment to where we're loaded mov ds, ax mov si, text_string ; Put string position into SI call print_string ; Call our string-printing routine jmp $ ; Jump here - infinite loop! text_string db 'This is my cool new OS!', 0 print_string: ; Routine: output string in SI to screen mov ah, 0Eh ; int 10h 'print char' function .repeat: lodsb ; Get character from

“times 510-($-$$) db 0” does not work

穿精又带淫゛_ 提交于 2019-12-06 04:09:11
I am learning about boot sectors. I downloaded nasm-installer-x64.exe from the NASM website. My operating system is win7-64bit. When I run the following code it does not work correctly mov ah, 0x0e; mov al, the_secret; int 0x10; mov al, [the_secret]; int 0x10; mov bx, [the_secret]; add bx, 0x7c00; mov al, [bx]; int 0x10; mov al, [0x7c1e]; int 0x10; jmp $; the_secret:; db 'X'; times 510-($-$$) db 0; dw 0xaa55; Michael Petch I don't believe there is anything wrong with times 510-($-$$) db 0 . It seems to me your are attempting to find the proper way to access the variable the_secret and then

STM32F4 Jump to Bootloader via SoftReset and without BOOT0 and BOOT1 Pin

雨燕双飞 提交于 2019-12-06 03:13:20
i ask because of an answer to a similar quastion which can be found here: Jump to Bootloader in STM32 through appliction i.e using Boot 0 and Boot 1 Pins in Boot mode from User flash The User "JF002" @JF002 answered "When I want to jump to the bootloader, I write a byte in one of the backup register and then issue a soft-reset. Then, when the processor will restart, at the very beginning of the program, it will read this register. This register contains the value indicating that it should reboot in bootloader mode. Then, the jump to the bootloader is much easier" Can someone explain that