bootloader

How to step over interrupt calls when debugging a bootloader/bios with gdb and QEMU?

无人久伴 提交于 2019-12-19 07:53:51
问题 For educational purposes, I have adapted this bootloader from mikeos.berlios.de/write-your-own-os.html rewriting it to specifically load at address 0x7c00. The final code is this: [BITS 16] ; Tells nasm to build 16 bits code [ORG 0x7C00] ; The address the code will start start: mov ax, 0 ; Reserves 4Kbytes after the bootloader add ax, 288 ; (4096 + 512)/ 16 bytes per paragraph mov ss, ax mov sp, 4096 mov ax, 0 ; Sets the data segment mov ds, ax mov si, texto ; Sets the text position call

bootloader - switching processor to protected mode

雨燕双飞 提交于 2019-12-18 10:02:58
问题 I'm having difficulties understanding how a simple boot loader works. The boot loader I'm talking about is the one from MITs course "Operating Systems Engineering". First, let me show you a piece of assembly code the BIOS executes: [f000:fec3] 0xffec3: lidtw %cs:0x7908 [f000:fec9] 0xffec9: lgdtw %cs:0x7948 [f000:fecf] 0xffecf: mov %cr0,%eax [f000:fed2] 0xffed2: or $0x1,%eax [f000:fed6] 0xffed6: mov %eax,%cr0 [f000:fed9] 0xffed9: ljmpl $0x8,$0xffee1 From the looks of it, This code sets up the

bootloader - switching processor to protected mode

微笑、不失礼 提交于 2019-12-18 10:02:01
问题 I'm having difficulties understanding how a simple boot loader works. The boot loader I'm talking about is the one from MITs course "Operating Systems Engineering". First, let me show you a piece of assembly code the BIOS executes: [f000:fec3] 0xffec3: lidtw %cs:0x7908 [f000:fec9] 0xffec9: lgdtw %cs:0x7948 [f000:fecf] 0xffecf: mov %cr0,%eax [f000:fed2] 0xffed2: or $0x1,%eax [f000:fed6] 0xffed6: mov %eax,%cr0 [f000:fed9] 0xffed9: ljmpl $0x8,$0xffee1 From the looks of it, This code sets up the

(NASM) (80x86) Bootloader NEEDS xor ax, ax

丶灬走出姿态 提交于 2019-12-18 09:01:12
问题 I am learning how to make a bootloader from osdev. I'm using NASM to assemble my code, and a x86 machine to run my bootloader. This is a little piece of code which prints a character and enter in a infinite loop: BITS 16 xor ax, ax mov ah, 0x0E mov al, 0x41 int 0x10 jmp $ times 510-($-$$) db 0x00 db 0x55 db 0xAA My question is: why doesn't the code run when I comment the 'xor ax, ax' instruction? As you can see in the code above, the ax value is changed to store the interrupt parameters, so

Debugging bootloader with gdb in qemu

匆匆过客 提交于 2019-12-18 04:43:07
问题 There seems to be a problem with the Freedos bootloader. (It appears that the bootcode can't find the kernel in certain circumstances.) So I'm trying to debug the bootloader in qemu with gdb. Following the instructions found on several wiki and freely available online course materials, I run qemu like this qemu-system-i386 -fda fdboot.img -boot a -s -S And then connect gdb like this $ gdb (gdb) target remote localhost:1234 I can step through the first 10 - 12 instructions with si which I

How to jump between programs in Stellaris

泄露秘密 提交于 2019-12-17 19:03:27
问题 I am working on a boot loader for Stellaris LM3S1607 chip. I am using Keil MicroVision4 C compiler. The idea is to create 2 independent firmware that one will update another. In firmware1 i downloaded firmware2 file and write it to flash in address 0x3200. untill here it is working. i also verifed that the data is being written to flash correct. Now i have in flash two applications. one is my uip boot loader and the seoncd one is my main project. i want to know how can i jump from the first

How to jump between programs in Stellaris

丶灬走出姿态 提交于 2019-12-17 19:01:51
问题 I am working on a boot loader for Stellaris LM3S1607 chip. I am using Keil MicroVision4 C compiler. The idea is to create 2 independent firmware that one will update another. In firmware1 i downloaded firmware2 file and write it to flash in address 0x3200. untill here it is working. i also verifed that the data is being written to flash correct. Now i have in flash two applications. one is my uip boot loader and the seoncd one is my main project. i want to know how can i jump from the first

CentOS系统启动流程你懂否

空扰寡人 提交于 2019-12-17 16:51:10
一、Linux内核的组成 相关概念: Linux系统的组成部分:内核+根文件系统 内核:进程管理、内存管理、网络协议栈、文件系统、驱动程序。 IPC(Inter-Process Communication进程间通信):就是指多个进程之间相互通信,交换信息的方法。Linux IPC基本上都是从Unix平台上继承而来的。主要包括最初的Unix IPC,System V IPC以及基于Socket的IPC。另外,Linux也支持POSIX IPC。 运行中的系统环境可分为两层:内核空间、用户空间; 内核空间:内核代码(系统调用) 用户空间:应用程序(进程或线程) 内核设计流派: 单内核设计:把所有的功能集成于同一个程序;(Linux) 微内核设计:每种功能都使用一个单独的子系统实现;(Windows solarls) Linux内核特点: (1)支持模块化:.KO(kernel object) (2)支持模块运动时动态装载或卸载 组成部分: 核心文件:/boot/Vmliuz-VERSION-release ramdirk: CentOS5:/boot/initrd-VERSION-release.img CentOS6,7:/boot/initramfs-VERSION-release.img 二、CentOS系统启动流程 总体启动顺序: POST(加点自检)-->Boot

How to make the kernel for my bootloader?

邮差的信 提交于 2019-12-17 05:08:11
问题 I'm trying to make my own custom OS and I need some help with my code. This is my bootloader.asm : [ORG 0x7c00] start: cli xor ax, ax mov ds, ax mov ss, ax mov es, ax mov [BOOT_DRIVE], dl mov bp, 0x8000 mov sp, bp mov bx, 0x9000 mov dh, 5 mov dl, [BOOT_DRIVE] call load_kernel call enable_A20 call graphics_mode lgdt [gdtr] mov eax, cr0 or al, 1 mov cr0, eax jmp CODE_SEG:init_pm [bits 32] init_pm: mov ax, DATA_SEG mov ds, ax mov ss, ax mov es, ax mov fs, ax mov gs, ax mov ebp, 0x90000 mov esp,

How to run a program without an operating system?

岁酱吖の 提交于 2019-12-17 02:00:14
问题 How do you run a program all by itself without an operating system running? Can you create assembly programs that the computer can load and run at startup, e.g. boot the computer from a flash drive and it runs the program that is on the CPU? 回答1: How do you run a program all by itself without an operating system running? You place your binary code to a place where processor looks for after rebooting (e.g. address 0 on ARM). Can you create assembly programs that the computer can load and run