‘hola mundo’ means ‘hello world’ in Spanish.
“Bare Metal” is a machine that offers direct access to the hardware, without any abstraction or virtualization layer. This means that the user has full control over the hardware and can install their own operating system, software and settings.
You have to create a program in assembly in real mode.
The following program is assembly for x86_64.
Is an example of a PC-Boot. It is a very basic bootloader that prints the message “Hola Mundo” on the screen.
- It runs directly without the need for an additional bootloader.
- It is limited to 512 bytes of code.
- It is loaded into memory by the BIOS.
- It does not use GRUB or any other bootloader.
- It is used on older x86 systems.
A PC-Boot is a type of bootloader used on older x86 systems. It is a very basic bootloader that is loaded into memory by the BIOS and executed directly.
types of bootloaders:
- PC-Boot
- Boot Sector Bootloader
- Direct Boot Bootloader
- Sector Load Bootloader
- MBR (Master Boot Record) Bootloader
- PC Bootstrap Loader
- Volume Boot Record (VBR) Bootloader
- Boot Sector Bootloader
PC Bootstrap Loader:
This type of bootloader is the one that is loaded into memory by the BIOS when a computer with a hard drive or solid state drive (SSD) is started.
A bootloader is a program that runs at system startup and is responsible for loading your application into memory.
bootloader.asm
[BITS 16]
[ORG 0x7C00]
mov ax, 0x07C0
mov ds, ax
; Display Settings
mov ah, 0x00
mov al, 0x03
int 0x10
; Printing the message
mov ah, 0x0E
mov al, 'H'
int 0x10
mov ah, 0x0E
mov al, 'o'
int 0x10
mov ah, 0x0E
mov al, 'l'
int 0x10
mov ah, 0x0E
mov al, 'a'
int 0x10
mov ah, 0x0E
mov al, ' '
int 0x10
mov ah, 0x0E
mov al, 'M'
int 0x10
mov ah, 0x0E
mov al, 'u'
int 0x10
mov ah, 0x0E
mov al, 'n'
int 0x10
mov ah, 0x0E
mov al, 'd'
int 0x10
mov ah, 0x0E
mov al, 'o'
int 0x10
jmp $
TIMES 510-($-$$) DB 0
DW 0xAA55
the program:
- It runs directly without the need for an additional bootloader.
- It is limited to 512 bytes of code.
- It does not use GRUB or any other bootloader.
- It is loaded into memory at address 0x7C00.
- It sets the video mode to 80×25 text mode.
- It prints the message “Hello World” on the screen.
- It runs indefinitely.
what the program does:
- memory address 0x7C00, which is the address where the BIOS loads the boot sector.
- addressing mode: The code uses 16-bit addressing mode, as indicated on the first line [BITS 16]. This means that memory addresses are expressed in 16 bits, which limits the amount of memory that can be accessed.
- Load address: The program load address is 0x7C00, as indicated in the second line [ORG 0x7C00]. This means that the BIOS loads the boot sector at this memory address.
- Setting the video mode: The mov ah, 0x00 line loads the value 0x00 into the AH register. Then the mov al, 0x03 line loads the value 0x03 into the AL register. Finally, the int 0x10 line calls interrupt 0x10, which is the video interrupt. The value 0x03 in AL sets the video mode to 80×25 text mode.
- Printing Characters: The following lines print the characters “Hello World” to the screen. Each character is printed using interrupt 0x10, with the value 0x0E in AH and the character to be printed in AL.
- Infinite loop: The jmp$ line creates an infinite loop, meaning the program will run indefinitely.
- Byte padding: The TIMES 510-($-$$) DB 0 line pads the remaining bytes of the boot sector with zeros. This is necessary because the boot sector must be exactly 512 bytes long.
- Boot Mark: DW line 0xAA55 places the boot mark at the end of the boot sector. This mark is required for the BIOS to recognize the boot sector as a valid boot program.
compile and generate .bin:
nasm -f bin bootloader.asm -o bootloader.bin
create image .img:
dd if=bootloader.bin of=bootloader.img bs=512 count=1
copy to usb:
sudo dd if=bootloader.img of=/dev/sdb bs=4M
my usb is /dev/sdb you can see your device with lsblk, without /dev
sync data:
sudo sync
The following commands show the hexadecimal information of /dev/sdb, the USB and the bootloader.img file:
Information is displayed only in the first 512 bytes, This is because if the USB is, for example, 64 GB, the 64 GB of information will be displayed and not the first 512 bytes.
Check that there is the same information in the bootloader.img file and in /dev/sdb on the USB.
The USB does not have a partition, but instead makes an exact copy per sector on the device, starting from the beginning, the first bytes.
sudo hexdump -C -n 512 /dev/sdb
hexdump -C -n 512 bootloader.img
demonstration
connect usb to computer:

enter the bios, press ‘delete’ at the beginning to enter
In the BIOS go to the boot section:

Select the USB flash drive first in order of priority:


that is the process of booting a usb.
After starting the computer it shows the message ‘Holundo’

in video:
The message on this computer is incorrect, it should display ‘Hola Mundo’
I’m investigating because it’s incorrect.
Maybe my BIOS is configured incorrectly.
yesplay slots
Thanks for finally writing about > Make a ‘Hola
Mundo’ on a bare metal PC from a USB stick – Leibnix < Loved it!
Thanks for finally writing about > Make a ‘Hola
Mundo’ on a bare metal PC from a USB stick – Leibnix < Loved it!
помощь наркозависимым
Write more, thats all I have to say. Literally,
it seems as though you relied on the video to make your point.
You definitely know what youre talking about, why waste
your intelligence on just posting videos to your site when you could be
giving us something informative to read?
WOW just what I was looking for. Came here by searching for Luntrixar
Hey! Do you use Twitter? I’d like to follow you if that
would be ok. I’m undoubtedly enjoying your blog and look forward to new posts.
A person essentially lend a hand to make severely
articles I might state. This is the first time I frequented your website
page and up to now? I surprised with the analysis you
made to make this particular post extraordinary.
Wonderful activity!
помощь наркозависимым
Hi there to every , since I am genuinely keen of reading this blog’s post to be updated daily.
It includes pleasant stuff.
Wonderful blog! I found it while surfing around on Yahoo News.
Do you have any tips on how to get listed in Yahoo
News? I’ve been trying for a while but I never seem to get there!
Many thanks
Thanks for sharing such a pleasant opinion, post is fastidious, thats why i have read it completely
This article provides clear idea designed for the new people of blogging, that in fact how to do running a blog.