Skip to content

Commit 74f2b29

Browse files
Comentarios okas ahora.
1 parent e148b71 commit 74f2b29

File tree

10 files changed

+26
-56
lines changed

10 files changed

+26
-56
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
ASM = nasm
22
#BMFS_MBR = bmfs_mbr.sys
33
#PXESTART = pxestart.sys
4-
PURE64 = pure64.sys
4+
BOOTLOADER = bootloader.sys
55
UEFI = uefi.sys
66

7-
#all: bmfs_mbr.sys pxestart.sys pure64.sys
8-
all: pure64.sys uefi.sys
7+
#all: bmfs_mbr.sys pxestart.sys bootloader.sys
8+
all: bootloader.sys uefi.sys
99

1010
#$(BMFS_MBR):
1111
# $(ASM) src/bootsectors/bmfs_mbr.asm -o $(BMFS_MBR)
1212

1313
#$(PXESTART):
1414
# $(ASM) src/bootsectors/pxestart.asm -o $(PXESTART)
1515

16-
$(PURE64):
17-
cd asm; $(ASM) pure64.asm -o ./../build/$(PURE64)
16+
$(BOOTLOADER):
17+
cd asm; $(ASM) bootloader.asm -o ./../build/$(BOOTLOADER)
1818

1919
$(UEFI):
2020
cd ./asm/boot; nasm uefi.asm -o ./../../build/uefi.sys

asm/boot/uefi.asm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ call [rcx + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_OUTPUTSTRING]
601601

602602

603603

604-
;;; parate aqui si quisieras ver los seteos que le va a pasar a pure64
604+
;;; parate aqui si quisieras ver los seteos que le va a pasar al siguiente bootloader.
605605

606606
mov rsi, PAYLOAD + 6
607607
mov rax, [rsi]
@@ -716,8 +716,7 @@ get_memmap:
716716
rep stosq
717717

718718

719-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; hacer un clear del screen
720-
; Set screen to black before jumping to Pure64
719+
;; Hacer un clear del screen.
721720
mov rdi, [FB]
722721
mov eax, 0x00000000 ; 0x00RRGGBB
723722
mov rcx, [FB_SIZE];;;;;;;;;; frame buffer size

asm/pure64.asm renamed to asm/bootloader.asm

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
5-
; The first stage loader is required to gather information about the system
6-
; while the BIOS or UEFI is still available and load the Pure64 binary to
7-
; 0x00008000. Setup a minimal 64-bit environment, copy the 64-bit kernel from
8-
; the end of the Pure64 binary to the 1MiB memory mark and jump to it.
1+
;;=============================================================================
2+
;; The first stage loader is required to gather information about the system
3+
;; while the BIOS or UEFI is still available and load the payload binary to
4+
;; 0x00008000. Setup a minimal 64-bit environment, copy the 64-bit kernel from
5+
;; the end of the payload binary to the 1MiB memory mark and jump to it.
96
;;1Mib mark se refiere a copiar nuestro kernel a la dir 100000 donde a donde luego salta yendo a _start en 0x100000
10-
;
11-
; Pure64 requires a payload for execution! The stand-alone pure64.sys file
12-
; is not sufficient. You must append your kernel or software to the end of
13-
; the Pure64 binary. The maximum size of the kernel or software is 26KiB.
14-
;
15-
; Windows - copy /b pure64.sys + kernel64.sys
16-
; Unix - cat pure64.sys kernel64.sys > pure64.sys
17-
; Max size of the resulting pure64.sys is 32768 bytes (32KiB)
18-
; =============================================================================
7+
;;
8+
;; requires a payload for execution! The stand-alone bootloader.sys file
9+
;; is not sufficient. You must append your kernel or software to the end of
10+
;; the bootloader binary. The maximum size of the kernel or software is 26KiB (a definir!!!)
11+
;;=============================================================================
1912

2013

2114

@@ -591,7 +584,7 @@ make_interrupt_gates: ; make gates for the other interrupts
591584

592585
lidt [IDTR64] ; load IDT register
593586

594-
; Patch Pure64 AP code ; The AP's will be told to start execution at 0x8000
587+
; Patch bootloader AP code ; The AP's will be told to start execution at 0x8000
595588
mov edi, start ; We need to remove the BSP Jump call to get the AP's
596589
mov eax, 0x90909090 ; to fall through to the AP Init code
597590
stosd
@@ -859,7 +852,7 @@ pde_end:
859852
shr rax, 24 ; Shift to the right and AL now holds the CPU's APIC ID
860853
shl rax, 10 ; shift left 10 bits for a 1024byte stack
861854
add rax, 0x0000000000050400 ; stacks decrement when you "push", start at 1024 bytes in
862-
mov rsp, rax ; Pure64 leaves 0x50000-0x9FFFF free so we use that
855+
mov rsp, rax ; leave 0x50000-0x9FFFF free so we use that
863856

864857
; Build the InfoMap
865858
xor edi, edi
@@ -1004,7 +997,7 @@ lfb_wc_end:
1004997
wbinvd ; Flush Cache
1005998

1006999
; Move the trailing binary to its final location
1007-
mov esi, 0x8000+UEFI_BOOTLOADER_SIZE ; Memory offset to end of pure64.sys
1000+
mov esi, 0x8000+UEFI_BOOTLOADER_SIZE ; Memory offset to end of bootloader.sys
10081001
10091002
;; esto es la direccion a la cual nuestro kernel se copia, tal como luego comienza ejecutando en _start en 100000
10101003
mov edi, 0x100000 ; Destination address at the 1MiB mark
@@ -1062,7 +1055,7 @@ clear_regs:
10621055

10631056

10641057
;;;;;;;;;;;;;;;;;;;;;;;;hlt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1065-
jmp 0x00100000 ; Done with Pure64, jump to the kernel
1058+
jmp 0x00100000 ; Done with bootloader, jump to the kernel
10661059

10671060

10681061
%include "init/acpi.asm"
@@ -1329,7 +1322,7 @@ debug_progressbar:
13291322
%endif
13301323

13311324

1332-
;;;;;;;;;;; para generar un loop y dejar q se vea mensaje antes de ir a pure
1325+
;;;;;;;;;;; para generar un loop y dejar q se vea mensaje antes de ir a bootloader
13331326
;;; sacar, no va
13341327
;;;time_delay dq 800000
13351328

asm/init/acpi.asm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; INIT ACPI
6-
;
7-
; Comments reference the following document:
3+
;; Comments reference the following document:
84
; Advanced Configuration and Power Interface (ACPI) Specification Release 6.5
95
; https://uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf
106
; =============================================================================

asm/init/cpu.asm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; INIT CPU - This code is called by all activated CPU cores in the system
63
; =============================================================================
74

asm/init/hpet.asm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; INIT HPET
63
; =============================================================================
74

@@ -154,4 +151,4 @@ HPET_TIMER_2_INT equ 0x150
154151

155152

156153
; =============================================================================
157-
; EOF
154+
; EOF

asm/init/smp.asm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; INIT SMP
63
; =============================================================================
74

asm/init/smp_ap.asm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; INIT SMP AP
63
; =============================================================================
74

@@ -126,7 +123,7 @@ startap64:
126123
shr rax, 24 ; Shift to the right and AL now holds the CPU's APIC ID
127124
shl rax, 10 ; shift left 10 bits for a 1024byte stack
128125
add rax, 0x0000000000090000 ; stacks decrement when you "push", start at 1024 bytes in
129-
mov rsp, rax ; Pure64 leaves 0x50000-0x9FFFF free so we use that
126+
mov rsp, rax ; Leave 0x50000-0x9FFFF free so we use that
130127

131128
lgdt [GDTR64] ; Load the GDT
132129
lidt [IDTR64] ; Load the IDT

asm/interrupt.asm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; Interrupts
63
; =============================================================================
74

asm/sysvar.asm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
; =============================================================================
2-
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
3-
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
4-
;
52
; System Variables
63
; =============================================================================
74

@@ -36,7 +33,7 @@ IM_ActivedCoreIDs: equ 0x0000000000005E00 ; 1 byte per entry - 1 if the core wa
3633
;;;[0x00005F10] ; Screen X
3734
;;;;[0x00005F12] ; Screen Y
3835
;;;;[0x00005F14] ; PixelsPerScanLine
39-
;;; luego, durante pure, la mantiene aqui, pero lo copia al infoMap 0x5080
36+
;;; luego, durante el bootloader, la mantiene aqui, pero lo copia al infoMap 0x5080
4037
VBEModeInfoBlock: equ 0x0000000000005F00 ; 256 bytes
4138

4239

0 commit comments

Comments
 (0)