fixing an issue with UNIX style EOL

This commit is contained in:
Gregory Kenneth Bowne 2024-09-09 15:43:14 -07:00
parent d8eaa406e7
commit f4f71fd3c2
4 changed files with 277 additions and 188 deletions

13
.gitignore vendored
View File

@ -50,3 +50,16 @@ modules.order
Module.symvers Module.symvers
Mkfile.old Mkfile.old
dkms.conf dkms.conf
# Binaries
*.bin
# Build system
Makefile
CMakeLists.txt
# source control and editor
.vscode
.vscode/
.github
.github/

View File

@ -1,2 +1,42 @@
cmake_minimum_required(VERSION 3.13.4) cmake_minimum_required(VERSION 3.13.4)
# Enable C, Assembly, and Shell scripting languages
enable_language(C ASM SH)
# Set up the project name and version
set(PROJECT_NAME "ClassicOS")
set(PROJECT_VERSION "0.0.1")
# Define the executable name
set(EXECUTABLE_NAME "${PROJECT_NAME}")
# Set the repository URL
set(REPOSITORY_URL "https://github.com/gbowne1/ClassicOS/")
# Add the assembly and C source files
add_executable(${EXECUTABLE_NAME}
boot.asm
kernel.c
)
# Configure compiler flags for assembly
set(ASM_FLAGS "-f elf32")
set_property(SOURCE boot.asm PROPERTY COMPILE_OPTIONS "${ASM_FLAGS} -o boot.o")
# Configure compiler flags for C
set(C_FLAGS "-m32 -ffreestanding -nostdlib -fno-pie -std=c11")
set_target_properties(${EXECUTABLE_NAME} PROPERTIES COMPILE_FLAGS "${C_FLAGS}")
# Link the object files together
target_link_libraries(${EXECUTABLE_NAME} PRIVATE boot.o kernel.bin)
# Specify the output format and entry point
set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_FORMAT "binary")
set_target_properties(${EXECUTABLE_NAME} PROPERTIES ENTRYPOINT "boot")
# Include the linker script
include_directories(linker.ld)
# Add a custom message
message(STATUS "Building ${PROJECT_NAME} version ${PROJECT_VERSION}")
message(STATUS "Repository: ${REPOSITORY_URL}")

386
README.md
View File

@ -1,175 +1,211 @@
# ClassicOS # ClassicOS
This operating system uses standard operating system concepts used in the 32 bit environment. It will eventually be ported to 64 bit including IA64. This operating system uses standard operating system concepts used in the 32 bit environment. It will eventually be ported to 64 bit including IA64.
This ClassicOS operating system, aims to support major hardware and software technology existing from when the first 32 bit systems appeared on the market through the early 2000's and most of those have been listed below. This ClassicOS operating system, aims to support major hardware and software technology existing from when the first 32 bit systems appeared on the market through the early 2000's and most of those have been listed below.
## Programming ## Programming
This project uses the C library and Assembly language. This project uses the C library and Assembly language.
## Toolchain ## Toolchain
GNU Make 4.2.1 GNU Make 4.2.1
CMake 3.13.4 CMake 3.13.4
GNU 8.3.0 GNU 8.3.0
gcc (Debian 8.3.0-6) 8.3.0 gcc (Debian 8.3.0-6) 8.3.0
nasm 2.14 nasm 2.14
GNU ld (GNU Binutils for Debian) 2.31.1 GNU ld (GNU Binutils for Debian) 2.31.1
binutils binutils
For testing, QEMU i386 and TigerVNC/VNCViewer on ::1:5900 For testing, QEMU i386 and TigerVNC/VNCViewer on ::1:5900
## Development (Team, etc) ## Development (Team, etc)
This project will use MIT or the GPL license and will be fully open source. This project will use MIT or the GPL license and will be fully open source.
Ideal situations aside, My goal has always been: Ideal situations aside, My goal has always been:
1-2 person working on bootloader 1-2 person working on bootloader
1-2 person working on kernel 1-2 person working on kernel
1-2 person working on drivers 1-2 person working on drivers
1-2 person working on issues/bugs 1-2 person working on issues/bugs
1-2 people working on applications/user-space 1-2 people working on applications/user-space
1-2 people working on Networking 1-2 people working on Networking
1-2 people working on memmory issues, stack issues, etc. 1-2 people working on memory issues, stack issues, etc.
at least one person doing hardware and software testing and writing tests in a test framework at least one person doing hardware and software testing and writing tests in a test framework
At least one major bug fix a week At least one major bug fix a week
At least one minor buf fix a week At least one minor buf fix a week
At least one new feature a month (or more) At least one new feature a month (or more)
## CPU Processor Support ## CPU Processor Support
This project initially aims to support all 32 bit Intel and AMD processors Including; This project initially aims to support all 32 bit Intel and AMD processors Including;
-- Intel -- -- Intel --
i386 SX and DX Processors i386 SX and DX Processors
i486 SX and DX Processors i486 SX and DX Processors
Pentium Processors (60 to 120MHz) Pentium Processors (60 to 120MHz)
Pentium Pro Processors Pentium Pro Processors
Pentium II Processors Pentium II Processors
Pentium II Xeon Processors Pentium II Xeon Processors
Pentium III Processors Pentium III Processors
Pentium III Xeon Processors Pentium III Xeon Processors
early Pentium 4 Processors (Willamette, Prescott, Northwood) early Pentium 4 Processors (Willamette, Prescott, Northwood)
-- AMD -- -- AMD --
AMD k5 AMD k5
AMD K6 AMD K6
AMD am386 AMD am386
AMD am486 AMD am486
Athlon Athlon
Duron Duron
Sempron Sempron
## Device Support ## Device Support
USB 1.0 USB 1.0
USB 1.1 USB 1.1
USB 2.0 USB 2.0
USB 2.1 USB 2.1
SATA 1 SATA 1
UDMA UDMA
UltraATA 66/100/133 UltraATA 66/100/133
SCSI-1 SCSI-1
SCSI-2 SCSI-2
SCSI-3 SCSI-3
Ultra-2 SCSI Ultra-2 SCSI
Ultra-3 SCSI Ultra-3 SCSI
ESDI ESDI
MFM/RLL MFM/RLL
## Booting ## Booting
BIOS from BIOS from
- primary hard disk partition - primary hard disk partition
- primary floppy - primary floppy
- ISO 9660 CD-ROM, CD-R,CD-RW, - ISO 9660 CD-ROM, CD-R,CD-RW,
- DVD - DVD
- Removable media (Zip, Jaz, USB, Tape, Syquest, Bernoulli, CF, SmartMedia, SD etc) - Removable media (Zip, Jaz, USB, Tape, Syquest, Bernoulli, CF, SmartMedia, SD etc)
Might eventually support GRUB/GRUB2 and/or UEFI/EFI. Might eventually support GRUB/GRUB2 and/or UEFI/EFI.
Include support for AHCI and ACPI Include support for AHCI and ACPI
## Bus Support ## Bus Support
ISA ISA
EISA EISA
VESA/VESA Local Bus (VLB) VESA/VESA Local Bus (VLB)
PCI PCI
PCI-X PCI-X
PCIe 1.0, 1.1, 2.0 PCIe 1.0, 1.1, 2.0
AGP AGP
DIN 41416/NuBUS DIN 41416/NuBUS
## Hardware support ## Hardware support
This OS aims to support major hardware existing from 1985 to early 2k's. This OS aims to support major hardware existing from 1985 to early 2k's.
## Memory Support ## Memory Support
up to 4GB up to 4GB
## Features ## Features
Has a GUI Has a GUI
Has a IDE Has a IDE
Has a text editor Has a text editor
Has compilers for compiled lanugages (C, C++, C#, Go, Java, Fortran, Pascal, Objective C, Haskell, ADA, Scala, Rust, Zig, Ocaml, Julia, Dart, Erlang, Elixir) Has compilers for compiled lanugages (C, C++, C#, Go, Java, Fortran, Pascal, Objective C, Haskell, ADA, Scala, Rust, Zig, Ocaml, Julia, Dart, Erlang, Elixir)
Has a Web Browser Has a Web Browser
Has a shell, tty, console, terminal Has a shell, tty, console, terminal
Has interpreters for interpreted languages like python 2 and python 3, JavaScript, BASIC, PHP, etc. Has interpreters for interpreted languages like python 2 and python 3, JavaScript, BASIC, PHP, etc.
Has a git client Has a git client
Has a video, audio editing and playing suite Has a video, audio editing and playing suite
Has a file browser (in GUI) Has a file browser (in GUI)
Has debuggers for languages/compilers, etc that output symbols, etc. Has debuggers for languages/compilers, etc that output symbols, etc.
## Video Support ## Video Support
-- Modes -- -- Modes --
CGA CGA
EGA EGA
VGA VGA
SVGA SVGA
MCGA MCGA
XGA XGA
HGA / Hercules HGA / Hercules
XGA-2 XGA-2
SXGA SXGA
UXGA UXGA
WXGA WXGA
8514/a 8514/a
VESA SVGA VESA SVGA
VESA/VLB VESA/VLB
AGP (1.0, 2.0, 3.0, 3.5, Pro) - 66MHz - aka AGP 1X, 2X, 4X, 8X AGP (1.0, 2.0, 3.0, 3.5, Pro) - 66MHz - aka AGP 1X, 2X, 4X, 8X
PCI Graphics PCI Graphics
-- Resolutions -- -- Resolutions --
## Networking ## Networking
Novell NE1000 Novell NE1000
Novell NE2000 Novell NE2000
## Drivers ## Drivers
-- Video card(s) -- Video card(s)
-- NIC's (3Com, Intel, etc.)
-- Audio 3dFx Voodoo2, Voodoo3 cards
NVIDIA NV1
## Filesystems NVIDIA Riva 128
ATI VGA Wonder
- FAT12 NVIDIA GeForce 256
- FAT16/FAT16B/FAT16X NVIDIA GeForce 2 GTS
- FAT32/FAT32X NVIDIA GeForce 3 Ti500
- NTFS ATI Radeon DDR
- HPFS ATI Radeon 9700 Pro
- HFS / HFS+ ATI Radeon 9800 Pro
- ext / ext2 / ext3 Matrox Millennium and MGA Millennium
- exFAT Matrox G400
- ZFS Matrox Mystique
- JFS Matrox G200
Matrox G400
ATI Mach8
ATI Mach32
ATI Mach 64
ATI 3D Rage
ATI Rage Pro
ATI Rage 128 Pro
ATI Rage Wonder
-- NIC's (3Com, Intel, etc.)
Intel EtherExpress Pro/100
3Com EtherLink I, II & III cards in the 3c5xx - 3c9xx series model range.
Linksys LNE series cards
Netgear FA3xx/FA4xx series and GA series cards
-- Audio
## Filesystems
- FAT12
- FAT16/FAT16B/FAT16X
- FAT32/FAT32X
- NTFS
- HPFS
- HFS / HFS+
- ext / ext2 / ext3
- exFAT
- ZFS
- JFS
## Build
nasm -f elf32 boot.asm -o boot.o ; gcc -m32 -ffreestanding -nostdlib -fno-pic -fno-pie -std=c11 kernel.c boot.o -o kernel.bin -T linker.ld
nasm -f elf32 boot.asm -o boot.o ; gcc -m32 -ffreestanding -nostdlib -fno-pic kernel.c boot.o -o kernel.bin -T linker.ld
nasm -f elf32 boot.asm -o boot.o ; gcc -m32 -ffreestanding -nostdlib -fno-pie kernel.c boot.o -o kernel.bin -T linker.ld

View File

@ -1,13 +1,13 @@
#include <stdint.h> #include <stdint.h>
void kmain(void) void kmain(void)
{ {
const uint16_t color = 0x0F00; const uint16_t color = 0x0F00;
const char *hello = "Hello C world!"; const char *hello = "Hello C world!";
volatile uint16_t *vga = (volatile uint16_t *)0xb8000; volatile uint16_t *vga = (volatile uint16_t *)0xb8000;
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
{ {
vga[i + 80] = color | (uint16_t)hello[i]; vga[i + 80] = color | (uint16_t)hello[i];
} }
} }