bootloader

Floppy disk sector count

泪湿孤枕 提交于 2020-01-05 08:21:22
问题 I am trying to understand why lseek() is used in this image creator. Why 5 bytes away from start of file? If I changed that number, the OS won't boot. The image creator creates a .img file with the bootloader.bin inside. /* modify the sector count */ total_sector_number = file_size / 512 lseek(disk_image_fd, 5, SEEK_SET); write(disk_image_fd, &total_sector_number, 2); write(disk_image_fd, &kernel_32_sector_number, 2); //printf("%d\n", lawl); printf("TOTAL_SECTOR_NUMBER : %d\n", total_sector

BIOS interrupt replaced with far-call NOT working

瘦欲@ 提交于 2020-01-05 07:45:31
问题 Important Note: Code in this question can render media unbootable!! So I was trying for my stack to never overflow, but here I am with a question. I tried to do a far call to the interrupt vector table address for INT 0x13 (in my case 0000f000 at 0x4C) after I pushed flags, from a bootloader. Int 0x13 (that writes to disk 200h starting with 0x0 address) didn't work. This makes no sense as wiki says interrupts are interchangeable in real mode with far calls preceded by a flags push: https://en

Build U-Boot SPL for custom board

谁都会走 提交于 2020-01-05 05:01:08
问题 I have built a custom board with a iMX6 Processor. Unfortunately i have not stripped out the Bootloader Config pins. They are still unconnected BGA-Balls. I do have access to UART1-3, JTAG and SD-Card interface and also to the BOOT0 and BOOT1 pins. No i would like to start a U-Boot. Therefore i have ported or added my own board to the configs. I can build U-Boot successfull (not tested on the board yet). Then i thought, i could download u-boot into the internal RAM of the i.MX6. unfortunately

Loading a kernel without a filesystem - osdev

萝らか妹 提交于 2020-01-05 04:57:35
问题 I built a bootloader to load my kernel onto the memory. The kernel code is lying on the sectors of the floppy. The 2 stage bootloader reads out raw bytes of memory from the floppy disk and places it on the memory and executes the kernel. This works good on the bochs emulator but fails on the qemu emulator. Some tutorials out there suggest keeping the kernel file on a file system (like FAT12) and then reading the file from it. So, I want to ask that would such a system actually work on a

Where to store the bootloader on a floppy image?

点点圈 提交于 2020-01-03 17:44:46
问题 I'm going to write and test a bootloader. In order to do this, I am planning to copy the bootloader onto a floppy image file and mount it in a VM. However, I'm not sure where to put the bootloader's machine code. Does it just get dumped into the first few bytes of the file? 回答1: The boot sector of the floppy was the first sector. If you're talking about a raw floppy image (1440K), it should be the first 512 bytes of the image file. From memory, this gets loaded by the BIOS into 7c00:0000

Develop a Bootloader In Assembly

走远了吗. 提交于 2020-01-01 13:57:53
问题 I've already done a part of my OS in Assembly, but now I want to build a own bootloader for it too instead of using GRUB. When I was developing my test OS in Assembly I remember that I boot it like this: org 0x7c00 bits 16 ; OS Kernel Here times 510 - ($-$$) db 0 dw 0xAA55 This I've already know. Now I want to use this and execute the "real" OS that will be a *.bin file written to the 2nd sector of the floppy. Then I want to know somethings How can I do a bootloader in Assembly to execute

Finding out which drive was booted in x86 bootloader

家住魔仙堡 提交于 2019-12-31 07:00:14
问题 I'm writing a game bootloader for x86. At one point, early in the booting, I need to load some sectors from my boot drive into memory. I do this with interrupt 0x13 (ah=02), and when I try it in my virtual machine it works like a charm. However when I burn the image to a usb drive, the machine fails to boot, and I pinned it down to the sector loading instructions, apparently my usb drive isn't drive 0 (Floppy A), so the read fails. How can I determine which drive was used to boot? Thanks! 回答1

简述linux操作系统启动流程

孤人 提交于 2019-12-30 19:15:34
Linux启动流程 POST-->BootSequence(BIOS)->Bootloader(MBR,grub)-->kernnel(ramdisk,initrd)-->rootfs(只读)-->switchroot-->/sbin/init-->社会默认运行级别-->运行系统初始化脚本,完成系统初始化-->关闭对应级别下需要停止的服务,启动对应级别下需要开启的服务-->设置登录终端-->启动图形端 init程序的类型: * SysV:init,CentOS 5之前,配置文件:/etc/inittab * Upstart:init,Centos 6,配置文件:/etc/inittab,/etc/init/*.conf * Systemd:systemd,Centos7,配置文件:/usr/lib/systemd/system、/etcsystemd/system POS power on self test,即加电自检,它是BIOS功能的一部分,完成对cpu、主板、内存、软硬盘子系统、显示子系统(包括显示缓存)、串并行接口、键盘、CD-ROM光驱等的检测,主要检测硬件的好坏。 BootSequence bootsequence为启动顺序,可在BIOS中设置,BIOS会根据次序查找各引导设备,其查找到第一个有引导程序(bootloader)的设备即为本次启动要用到的设备

Loading second stage of a bootloader

一笑奈何 提交于 2019-12-30 06:49:06
问题 I'm trying to create a small operating system for x86 machines and started writing the code for a fairly minimal bootloader. The bootloader I created is quite simple, it loads a small second bootloader from the sector located directly after the master boot record and jumps to that code. The bootloader code in the master boot record seems to run fine, the problem occurs when it tries to jump to the second stage bootloader. This second stage bootloader is supposed to output a letter indicating

uboot学习之uboot启动流程简述

情到浓时终转凉″ 提交于 2019-12-30 02:32:14
一、uboot启动分为了三个阶段BL0、BL1、BL2; BL0 表示上电后运行ROM中固化的一段程序,其中ROM中的程序是厂家写进去的,所以具体功能可能根据厂家芯片而有所不同。功能如下: 初始化系统时钟、特殊设备的控制器、启动设备、看门狗、堆栈、SRAM等硬件; 验证B1镜像,并且加载BL1镜像到SRAM中,然后跳转到BL1镜像的地址上。 BL0需要将BL1加载到对应的RAM上,这就涉及到它的启动模式,详细如下: 1.OneNand Boot模式 要了解OneNAND先得了解NOR Flash和NAND Flash。与NOR Flash相比,NAND Flash的读数据速度稍慢,但是擦写速度快得多,并且在容量、使用寿命、成本上也占有较大优势。NOR Flash的编程简单,而NAND Flash的编程较为复杂(因为它的flash管理需要特殊的接口)。NAND Flash一般用于存储数据,而NOR Flash一般用于存储启动代码。 NOR Flash带有SRAM接口,有足够的地址引脚来寻址,可以很容易地存取其内容的每一字节(有限的地址引脚是限制其容量的因素之一)。NAND Flash使用复杂的I/O口来串行地存取数据,各个产品或厂商的方法可能各不相同。为了弥补NAND Flash的不足,三星公司在NAND Flash芯片内集成了一个RAM接口,命名为OneNAND Flash