1,896 questions
Advice
0
votes
0
replies
30
views
Understanding of the early stages in boot on STM32MP157F
I applied the ST FWU reference solution on our own platform based on the STM32MP157F.
I have a few questions to clarify the default behavior:
What is the default behavior in the early boot stage? Do ...
-2
votes
0
answers
110
views
Bootloader freezes if kernel is larger than 512B
I have added some stuff in the new-stuff branch, and when I try to boot, it gets to the last "Entering protected mode..." step, but if I revert my kernel to how it was, it works just fine ...
2
votes
2
answers
119
views
Printing to VGA in protected mode crashes system
As you can see down at bottom on my stage 2 boot loader, I have a VGA write thing (Prints out "Starting kernel...", but when I use it, the system starts to boot loop, I have no idea why this ...
5
votes
1
answer
79
views
Bootloader crashing when jumping to 0x100000
I am having a problem with a bootloader I made. Mostly used code snippets from wiki.osdev.org, and screeck (on Github and Youtube) . The issue is: the bootloader cannot jump farther than 0xFFFFF, and ...
3
votes
2
answers
136
views
How can I correctly load the kernel to its canonical high address space
I am working on a small os with a custom boot loader targeting BIOS. For this, I need to map the kernel to its canonical high address space (0xFFFFFFFF80000000) and jump to its entry point.
For this, ...
4
votes
1
answer
111
views
nasm bios int 13h read sector issue [duplicate]
im trying to make a simple bootloader that loads a simple kernel and the problem is that the kernel code doesnt run i do see prints from the bootloader but not from the kernel here is my code:
boot....
-3
votes
1
answer
105
views
idt_64 definiton crashes the os [closed]
im following a udemy course on making an operating system from scratch, but i have run into a very bizarre error:
Makefile:
DISK = os.img
KERNEL = kernel.bin
BOOTSECTOR = bootsector
NASM = nasm
QEMU =...
2
votes
0
answers
82
views
Where am I wrong with writing transition from protected mode to IA-32e mode?
I try to code the transition from protected mode to IA-32e mode. It's a task in college. The problem that I can't debug 32 bit bootloader. I can only run QEMU and tell based on its output whether this ...
1
vote
0
answers
32
views
STM32H7 Hardware CRC mismatch with srec_cat generated CRC32 [duplicate]
I’m working on STM32H755 bootloader project where I need to verify the integrity of the application firmware using a CRC32 checksum.
The build system uses srec_cat to append the CRC32 at the end of ...
1
vote
0
answers
47
views
How can I modify the LED PWM configuration in the UF2 bootloader for the ATSAMD51J19A?
I'm working on a project using the ATSAMD51J19A with a UF2 bootloader, which appears as a storage device over USB for easy firmware updates. Currently, the bootloader sets an LED using a PWM signal on ...
1
vote
1
answer
245
views
custom bootloader for stm32F407vgt6e
I'm writing a custom bootloader from scratch for an STM32 project. Currently, the bootloader only initializes and jumps to the main application. I'm gradually adding peripherals one by one. Everything ...
3
votes
1
answer
153
views
INT 13, AH=42h fails with AH=1, CF=1
I am trying to write a simple bootloader which loads my program from LBA=1 into memory and jumps to its start. I emulate my bootloader in qemu with -drive flag passed. When I try to read blocks from ...
4
votes
1
answer
191
views
Is 0x0000:0x7000 a unsafe address to load your kernel? Or is it just qemu annoying me
So I thought I'd try to make a DOS copy but it runs on a floppy and its just a simple plug and play with fat12 partition for user applications and drivers.
I first attempted to load my kernel using ...
4
votes
2
answers
191
views
MBR works in QEMU/BOCHS but not on real hardware
I threw together a makeshift MBR for a chainloader project I have been working on for sometime now. I tested on QEMU and BOCHS and no issues, besides throwing earlier 386 BIOS images into the mix (...
1
vote
1
answer
115
views
I'm writing an Assembly x86 bootloader, but the printing function doesn't print the given string correctly
I'm writing a bootloader in x86 Assembly for my operating system. Note that I have already wrote a few bootloaders and I never faced this problem. This is the code that I compile with NASM (precisely ...
2
votes
1
answer
104
views
Stuck on Second Stage Bootloader – Turbo C + TASM + DOSBox + QEMU Setup
I'm working on a retro programming project and running into trouble with my bootloader setup. I'm using:
Turbo Assembler 4.01 for the first-stage bootloader (x86 Assembly)
Turbo C 2.0 for the second-...
2
votes
1
answer
91
views
Why does UEFI GetMemoryMap return EFI_BUFFER_TOO_SMALL after allocating a buffer of the reported size?
I'm writing a UEFI application in Zig.
I'm calling GetMemoryMap() twice: once to get the required buffer size, then again after allocating the buffer using AllocatePool().
Here's my code:
fn ...
0
votes
0
answers
96
views
Bootloader flickers after enabling paging in x64 long mode
I am working on a simple bootloader in assembly. everything works fine until i enable paging and jump to 64 bit mode but then qemu just flickers. i think its a page fault but i am not sure what's ...
0
votes
1
answer
56
views
Problem retrieving the flat memory frame buffer address using VESA
I can't pass the address of the linear framebuffer to vbe
I tried via:
mov eax, [ModeInfoBlock + 0x28]
mov [0x8000], eax
but 0x8000 is always zero, but if I write mov [0x8000], 0x12345, then it ...
-5
votes
2
answers
94
views
Why does my 32bit kernel randomly flicker?
For some reason every time I try entering 32bit protected mode.. it always FLICKERS AND FLICKERS FOR NO REASON..
I am using QEMU and my kernel is being assembled into a raw binary and then written ...
1
vote
1
answer
79
views
Why does AVR-GCC show the line "text+data+bootloader" when compiling the simple LED blinker?
Avr-gcc 7.1, Win10.
When compiling a simple LED blinker C code using avr-gcc, it outputs:
Invoking the avr-gcc is done by hand using:
avr-gcc -g -Os -mmcu=attiny13a -c "Attiny_blink_01.c"
...
0
votes
1
answer
53
views
How to make framebuffer
I have a function to write data in framebuffer:
_print_c:
mov ax, di
mov edi, 0x000B8000
mov byte [edi], al
mov ax, si
mov byte [edi + 1], al
shl byte [edi + 1], 4
and ...
1
vote
1
answer
54
views
Why does enabling long mode throw the bootloader into boot loop and mess up GDT base when PM mode works fine without LM code?
Problem
I have a working PM code, but as soon as I add LM setup, the GDT base gets assigned a garbage address, cr registers don't load properly and I get into a boot loop.
I tried hard-coding the ...
1
vote
2
answers
167
views
How to Enable Flash Encryption After Secure Boot V2 is Enabled? [closed]
I’ve successfully enabled Secure Boot V2 on my ESP32 device using ESP-IDF, and everything is working fine. Now, I want to enable Flash Encryption as the next step in securing my firmware.
I’m ...
0
votes
0
answers
80
views
How to debug linux boot loader with gdb and QEMU
I am trying to set up gdb and Qemu to debug the boot loader code in the linux kernel.
I have compiled a vmlinux image with all the correct flags. I run a qemu instance with qemu-system-x86_64 -m 256 -...
3
votes
1
answer
88
views
Why does working Assembly code not work when loaded into different memory by disk read?
Problem
I have assembly code that switches to 32bit mode and prints a character successfully when I have it inside the boot sector -
But when I use a disk read to load the code to the next sector the ...
2
votes
1
answer
57
views
Register corruption when iterating in a nested loop
It's my first time writing x86-16 assembly. I'm writing a bootloader game, but I'm struggling with iterating through level data.
I'm attempting to iterate through a 2d array - each byte of this array ...
2
votes
1
answer
108
views
Segment:Offset instead of org 0x7C00 directive
Recently I tried to implement the bootloader from scratch on x86 assembly using NASM. I am aware that the BIOS loads the bootsector to address 0x7C00 and for that reason all the offsets and memory ...
0
votes
1
answer
49
views
Placement of %include in my NASM bootloader affects program behavior
I am learning to write a 16-bit bootloader using NASM with BIOS interrupts to print strings to the screen. I’ve created a simple print subroutine in an external file (printer.asm), and I'm using %...
2
votes
0
answers
76
views
From-VESA VBE Not Displaying Any Output as Intended
I've recently been working on a mini operating system written completely from scratch. After implementing a bootloader and minimalised kernel, I tested the whole program on GDB, with the breakpoint ...
1
vote
3
answers
125
views
Bootloader in Assembly for BIOS Legacy: Keyboard input works in .img but screen is blank; in .iso the menu appears but keyboard input is ignored
I'm developing a small bootloader project in Assembly for BIOS Legacy (real mode). It displays a disk selection menu using BIOS interrupts (INT 10h for video, INT 16h for keyboard).
However, I'm ...
0
votes
0
answers
50
views
"rauc status mark-active other" in the scheme with 1 slot
The question is about how the rauc status mark-active other command work with the layouts with only 1 slot for the element (A/B scheme is not supported).
We use RAUC for updates management on our ...
0
votes
1
answer
84
views
Bootloader on STM32 MCU
I am trying to develop a bootloader with STM32F469BIT mcu. First of all, I divided the 2048K flash area allocated to me into zones according to certain sector addresses. These areas;
Bootloader -> ...
1
vote
0
answers
57
views
Kernel file not loading correctly in MASM
Just making a simple OS as a beginner for my assembly project. I have this very simple bootloader which prints a character B and reads the second sector (kernel) from drive and loads it at 10000h ...
1
vote
0
answers
73
views
Bootloader Fails to Load More Than 53 Sectors Despite Modifications
https://github.com/UdayKhare09/EXO_OS is my repo.
I am working on a custom bootloader for my operating system, and I am encountering an issue where the bootloader fails to load more than 53 sectors ...
0
votes
0
answers
36
views
Why debug iso file and specific file is different?
[ORG 0x7C00]
[BITS 16]
%define CODE_OFFSET 0x8
%define DATA_OFFSET 0x10
%define KERNEL_POS 0x1000 ; 4096 bits dec, 512 bytes
; loader - 512 size bytes,
; then kernel will ...
0
votes
0
answers
48
views
BLE Buttonless DFU App Crashes After Setting High on P0.27 and P1.07 – nRF52840 Custom Board (nRF5 SDK v16.0.1)
I'm currently working on a custom board based on the nRF52840, using SoftDevice S140 v7.0.1 and nRF5 SDK v16.0.1. I’ve integrated the BLE Buttonless DFU example (examples/dfu/secure_bootloader/...
2
votes
1
answer
90
views
Performing multiplication of 32-bit numbers in 16-bit real mode in order to traverse FAT table
I am writing a simple bootloader (and, hopefully soon, an operating system). I have been making progress, but this part is stumping me a bit.
I am writing this operating system and bootloader into a ...
-1
votes
1
answer
117
views
Why these ascii characters in this string in asm code will automatically subtract 1?
org 0x7c00
BOOTDRIVE equ 0x9000
flatcode equ 0x0008
flatdata equ 0x0010
...
2
votes
1
answer
149
views
Problem with jumping to application - STM32 Bootloader
I am making software bootloader for my STM32F407, and i managed to successfully write firmware in flash, starting at address 0x08004000 and I want to jump to it so my board can start executing that ...
4
votes
1
answer
150
views
STM32F407 Software Bootloader - Problem with receiving UART data
I am trying to make software bootloader for my STM32F407 project and I ran into some issue. The whole idea is that I send data using UART protocol from my PC to STM32F407. Data that I am sending is ...
0
votes
0
answers
76
views
what I do wrong when trying to switch in protected mode?
[ORG 0x7C00]
[BITS 16]
CODE_OFFSET equ 0x8
DATA_OFFSET equ 0x10
KERNEL_POS equ 0x1000 ; 4096 bits dec, 512 bytes
; loader - 512 size bytes,
; then kernel will placed to ...
4
votes
1
answer
136
views
Can't get welcome messages to load in QEMU
I am trying to make my own OS and am currently stuck on one tiny problem.
My welcome messages are not loading in the terminal.
Other than that, everything seems to work fine. (I'm not too sure, so ...
0
votes
1
answer
86
views
How to get disk size?
I need the total disk size in bytes to be displayed at startup, as well as some additional information.
I tried doing it this way, but the data displayed on the screen was completely wrong:
[BITS 16]
[...
2
votes
1
answer
135
views
Issue when running Makefile on boot.asm, "init :: non dos media"
I've been trying to build a custom OS following the steps in this guide. However, I continue to get the following error from my Makefile,
init :: non DOS media
Cannot initialize '::' ::kernel.bin: ...
0
votes
0
answers
256
views
u-boot 4 byte addressing spi nor flash on boot
How do I force u-boot to read spi nor flash in 4 byte addressing mode rather than switching from 3 bytes to 4?
Hardware:
I have a custom-built board based on mt7628nn with 128 MB DDR2 RAM and 32 mb ...
2
votes
1
answer
97
views
EFI variables or config file on the EFI partition for EFI application?
I'm writing a small EFI application with gnu-efi, which boots depending on the Wake-Up Type into Ubuntu or Windows.
The application works, but I want to configure the WakeUp Type - Boot Option mapping ...
0
votes
0
answers
67
views
STM32F051R8T6 Bootloader IAP Jump to APP Hard Fault Error
Hi I am trying to develop USART IAP Bootloader code for STM32F051_Disco but when Bootloader call JUMP User App it's getting hard fault error.
I have checked (Memory-File Compare) code copied into ...
3
votes
1
answer
93
views
Custom Bootloader Fails to Load C Kernel (kernel.c), But Works with Assembly (kernel.asm)
I'm writing a custom OS with my own bootloader and trying to switch from an assembly-based kernel (kernel.asm) to a C-based kernel (kernel.c).
When using kernel.asm, everything works fine. But when I ...
1
vote
0
answers
119
views
CPU Reset When Remapping the PIC Using Limine Bootloader in My OS
I'm currently developing an operating system that uses the limine bootloader and follows the limine boot protocol. However, I've encountered an issue: when I call init_PIC(), the CPU resets ...