Skip to content
Merged

2026 #106

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Return Infinity
Copyright (c) 2026 Return Infinity

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 17 additions & 17 deletions docs/CREDITS.TXT
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
===============================================================================
Pure64 -- a 64-bit loader written in Assembly for x86-64 systems
Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
===============================================================================
PROJECT ADMIN (MAIN CODE AND DOCUMENTATION)
* Ian Seyler -- ian.seyler@returninfinity.com
DEVELOPMENT AND TESTING
* Members of OSDev.org
===============================================================================
===============================================================================
Pure64 -- a 64-bit loader written in Assembly for x86-64 systems
Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
===============================================================================


PROJECT ADMIN (MAIN CODE AND DOCUMENTATION)

* Ian Seyler -- ian.seyler@returninfinity.com


DEVELOPMENT AND TESTING

* Members of OSDev.org


===============================================================================
6 changes: 3 additions & 3 deletions src/boot/bios-floppy.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 MBR -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; This Master Boot Record will load Pure64 from a pre-defined location on the
; floppy drive without making use of the file system.
Expand Down Expand Up @@ -149,13 +149,13 @@ VBESearch:

; Read the 2nd stage boot loader into memory.
; Load 4 cylinders - 7 sectors
mov byte [cylinder], 0
mov byte [cylinder], 0
mov word [sec_buff], 0x7E00 ; For simplicity load whole cylinder but jump to 0x8000
call load_sector
mov byte [head], 1
mov word [sec_buff], 0xA200
call load_sector
mov byte [cylinder], 1
mov byte [cylinder], 1
mov byte [head], 0
mov word [sec_buff], 0xC600
call load_sector
Expand Down
2 changes: 1 addition & 1 deletion src/boot/bios-novideo.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 MBR -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; This Master Boot Record will load Pure64 from a pre-defined location on the
; hard drive without making use of the file system.
Expand Down
2 changes: 1 addition & 1 deletion src/boot/bios-pxe.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 PXE Start -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; This is a stub file for loading Pure64 and a kernel/software package via PXE.
;
Expand Down
2 changes: 1 addition & 1 deletion src/boot/bios.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 MBR -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; This Master Boot Record will load Pure64 from a pre-defined location on the
; hard drive without making use of the file system.
Expand Down
2 changes: 1 addition & 1 deletion src/boot/uefi.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; UEFI loader for Pure64
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; Adapted from https://stackoverflow.com/questions/72947069/how-to-write-hello-world-efi-application-in-nasm
; and https://github.com/charlesap/nasm-uefi/blob/master/shoe-x64.asm
Expand Down
4 changes: 2 additions & 2 deletions src/fdc/dma.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; DMA Driver
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
; Implemented by Isa Isoux -- https://github.com/isoux/BMFLFS

; The DMA controller performs data transfers:
Expand Down Expand Up @@ -31,7 +31,7 @@ DMA1_CHR_ADDR EQU 0x81
; bl = channel
; bh = 1 = read, 0 = write
; esi = count
dma_IO:
dma_IO:

; Examine whether it is writing or reading
; what_mode
Expand Down
8 changes: 4 additions & 4 deletions src/fdc/fdc_64.asm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
; =============================================================================
; Floppy Disk Driver
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
; Implemented by Isa Isoux -- https://github.com/isoux/BMFLFS

; Here is a minimal simplified version intended only for reading whole floppy
; Here is a minimal simplified version intended only for reading whole floppy
; disk into memory or writing back image from memory to whole disk at once.
; Errors are poorly handled due to the simplicity of the handling, one thing
; that can be easily noticed is that the disk is damaged and does not load
; Errors are poorly handled due to the simplicity of the handling, one thing
; that can be easily noticed is that the disk is damaged and does not load
; completely.

; FDC - Floppy Disk Controler
Expand Down
2 changes: 1 addition & 1 deletion src/init/acpi.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT ACPI
;
Expand Down
2 changes: 1 addition & 1 deletion src/init/cpu.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT CPU - This code is called by all activated CPU cores in the system
; =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/init/serial.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT SERIAL - 115200 bps, 8N1 (8 data bits, no parity, and 1 stop bit)
; =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/init/smp.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT SMP
; =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/init/smp_ap.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT SMP AP
; =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/init/timer.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; INIT TIMER
; =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/interrupt.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; Interrupts
; =============================================================================
Expand Down
32 changes: 30 additions & 2 deletions src/pure64.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; The first stage loader is required to gather information about the system
; while the BIOS or UEFI is still available and load the Pure64 binary to
Expand Down Expand Up @@ -68,6 +68,12 @@ bootmode:
mov [0x5FFC], edx
mov [0x5FF8], eax

; Set up the Page Attribute Table (PAT). This will happen twice for the BSP.
mov edx, 0x00000105 ; PA7 UC (00), PA6 UC (00), PA5 WC (01), PA4 WP (05)
mov eax, 0x00070406 ; PA3 UC (00), PA2 UC- (07), PA1 WT (04), PA0 WB (06)
mov ecx, IA32_PAT
wrmsr

mov eax, 16 ; Set the correct segment registers
mov ds, ax
mov es, ax
Expand Down Expand Up @@ -117,7 +123,7 @@ bootmode:
stosw ; BitsPerPixel
%endif

; Clear memory for the Page Descriptor Entries (0x210000 - 0x25FFFF)
; Clear memory for the temporary Page Descriptor Entries (0x210000 - 0x25FFFF)
mov edi, 0x00210000
mov ecx, 320 * 1024 / 4
rep stosd ; Write 320KiB
Expand Down Expand Up @@ -168,6 +174,28 @@ pde_low_32: ; Create a 2 MiB page
cmp ecx, 2048
jne pde_low_32 ; Create 2048 2 MiB page maps.

%ifndef NOVIDEO
; Set the Linear Frame Buffer memory to WC
lfb_twc_2MB:
mov ecx, 4 ; 4 2MiB pages - TODO only set the pages needed
mov edi, 0x00210000
mov eax, [0x00005F00] ; Base address of video memory
shr eax, 18
add edi, eax
lfb_twc_2MB_nextpage:
mov eax, [edi] ; Load the 8-byte value
or ax, 0x1008 ; Set bits 12 (PAT) and 3 (PWT)
and ax, 0xFFEF ; Clear bit 4 (PCD)
mov [edi], eax ; Write it back
add edi, 8
sub ecx, 1
jnz lfb_twc_2MB_nextpage
lfb_twc_end:
mov eax, cr3 ; Flush TLB
mov cr3, eax
wbinvd ; Flush Cache
%endif

; Load the GDT
lgdt [tGDTR64]

Expand Down
2 changes: 1 addition & 1 deletion src/sysvar.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2025 Return Infinity -- see LICENSE.TXT
; Copyright (C) 2008-2026 Return Infinity -- see LICENSE.TXT
;
; System Variables
; =============================================================================
Expand Down
Loading