bootloader

How to fix “os.asm:113: error: TIMES value -138 is negative” in assembly language

可紊 提交于 2019-12-24 08:03:19
问题 I'm developing an operating system in assembly language. At a certain time i get this error from NASM: os.asm:113: error: TIMES value -138 is negative I want to take this project to the end. Only the errors like that despair me! Here is the 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 call cls MOV AH, 06h ; Scroll up

Weird Errors While Reading Disk

此生再无相见时 提交于 2019-12-24 07:31:16
问题 So, I've been working on a hobby project. Creating my own Operating System. I started a while back but dropped it until maybe a couple nights ago. I just fixed an oversight that caused nothing to be read from the sectors I want to read from. With that error out of the way, a new one has came about and I honestly don't even know where to begin debugging this one. I am coding a Master Boot Record and debugging it with GDB and QEMU, here is the code to my master boot record (It was assembled

Displaying text without interrupts

拥有回忆 提交于 2019-12-24 05:51:12
问题 I am trying to make my own boot-loader. As I will not have any interrupts when I change from 16bit to 32 bit mode, I will not be able to use int 10h . Here is the code I have so far: org 0x7c00 ; add to offsets xor ax, ax ; make it zero mov ds, ax ; ds=0 mov ss, ax ; stack starts at 0 cld mov ax, 0xb800 ; Ax = address of video memory mov es, ax xor di, di call print ; call thr print function hang: jmp hang ; constanly loop print: mov si, msg ; load msg into si mov cx, 4 mov ah, 07h printchar:

How to erase just some bytes of Flash Memory?

a 夏天 提交于 2019-12-24 05:42:06
问题 My PIC18F87J11 only erases 1024 bytes at a time. Is there away to force it to only erase 2 bytes or more at a time? I am making a Bootloader and sometimes only one line of the HEX file (16 bytes) changes for the application program, so I want to replace that line in memory with the new 16 bytes only . If I try to erase those 16 bytes, automatically 1024 bytes get erased too. Then I am forced to re-write them which takes some time and reduce the speed of the Bootloader. Is there an alternative

Using BIOS int 13h to access sectors in different heads

夙愿已清 提交于 2019-12-24 05:37:26
问题 I have a disk with 63 sectors per track. (I assume, based on my observations) I want to read sectors on a 16 bit bootloader using int 13h. For example, if I want to read sector number 63, I would do the following: mov dl,0x80;Drive number mov dh,0 ;This is head number/platter number mov ch,0 ;This is cylinder number mov cl,63 ;Sector number mov ah,0x02 ;interrupt function mov al,1 ;Number of sectors to be read xor bx,bx mov es,bx ;Making es=0 mov bx,0x8000 ;Any random buffer address int 0x13

Retrieve the partition number of BootMgr on Windows Vista and later

痴心易碎 提交于 2019-12-24 05:32:36
问题 I need to map Boot Manager to a partition number: Manufacturer Recovery partition = Partition 0 Boot manager = Partition 1 C:\ = Partition 2 D:\ = Partition 3 For mounted partitions, like C:\ or D:\, I use IOCTL_STORAGE_GET_DEVICE_NUMBER to retrieve partition numbers. Now I would like to do something similar to get the number of the Windows Boot Manager. I can't assume that the BootMgr is the 100 MB partition or the previous to the System partition. I have had a look to IOCTLs related to disk

Retrieve the partition number of BootMgr on Windows Vista and later

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 05:32:07
问题 I need to map Boot Manager to a partition number: Manufacturer Recovery partition = Partition 0 Boot manager = Partition 1 C:\ = Partition 2 D:\ = Partition 3 For mounted partitions, like C:\ or D:\, I use IOCTL_STORAGE_GET_DEVICE_NUMBER to retrieve partition numbers. Now I would like to do something similar to get the number of the Windows Boot Manager. I can't assume that the BootMgr is the 100 MB partition or the previous to the System partition. I have had a look to IOCTLs related to disk

嵌入式系统烧写uboot/bootloader/kernel的一般方法

只谈情不闲聊 提交于 2019-12-24 03:54:02
嵌入式系统烧写uboot/bootloader/kernel的一般方法 本文介绍了在嵌入式系统中烧写uboot/bootloader/kernel 的一般方法,以及如果uboot或者内核出现错误, www.2cto.com 引导失败等情况时如何重新烧写uboot/kernel. 烧写uboot/kernel的方式一般有两种,一种是在linux本身(shell中),直接将uboot/kernel的影像文件(二进制文件)使用操作烧写flash的命令烧写到flash特定分区上, 另一种是在uboot界面上,通过配置serverip,ipaddr,使用tftp命令 下载 uboot/kernel到flash上 例子如下: //一,在linux的shell中烧写uboot/kernel mtd write命令是自定义的烧写flash命令。 //烧写uboot ,/dev/mtd0 是bootloader 的特定分区 mtd write u-boot.bin /dev/mtd0 //烧写kernel, mtd1 是kernel的特定分区 mtd write vmlinux.elf /dev/mtd1 //重启 reboot //二,在uboot界面中烧写uboot/kernel,以kernel为例子 //在bootloader 界面中 //本机uboot 的ip地址 setenv ipaddr

bootloader printing on video memory 0xb8000

ぃ、小莉子 提交于 2019-12-24 00:48:28
问题 I am 3-4 days old in assembly programming. trying to print a string in video memory and running through qemu. I expected this program to print Hallo world. But it prints nothing. qemu window prints "Booting From Hard Disk ..." Nothing else Is it only 16 bit that is allowed in bootloader ? in that case how will I do MMIO ? I was following actual page 32 [ ENTERING 32-BIT PROTECTED MODE ] of http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf [bits 32] [org 0x7c00] loop: mov

NASM: Disk read timeout

拈花ヽ惹草 提交于 2019-12-24 00:02:50
问题 Trying to read data from disk (from the same file), loading 2 additional 512-byte sectors into memory. Disk read function as is: ; read DH sectors to ES:BX from drive DL disk_read: push dx push bx ; Tried to check if disk is ready first, this code runs without errors mov ah, 0x10 int 0x13 jc disk_not_ready mov bx , DISK_CURRENT_STATUS_MSG call print_string mov bx, 0 mov bl , ah call print_hex pop bx mov ah , 0x42 ; BIOS read sector function mov al , dh ; Read DH sectors mov ch , 0x00 ; Select