Git Product home page Git Product logo

pritamzope / os Goto Github PK

View Code? Open in Web Editor NEW
626.0 26.0 98.0 12.52 MB

Writing & Making Operating System and Kernel parts so simple like Hello World Programs, Starting from writing Bootloaders, Hello World Kernel, GDT, IDT, Terminal, Keyboard/Mouse, Memory Manager, HDD ATA R/W, VGA/VESA Graphics

Home Page: http://createyourownos.blogspot.com

Assembly 17.98% C 75.70% Shell 1.28% Makefile 5.04%
os osdev kernel kernel-driver x86-assembly x86-nasm bootloader graphics assembly hello-world

os's Introduction

OS

Simple Operating System programs starting from Bootloader in assembly to Kernel in C, and other programs like OS Calculator, Low Level Graphics etc.

Kernel contains C programs for Simple HelloWorld, Keyboard I/O etc... and little bit assembly programs for low level operations.

VGA contains C kernel and assembly program for seeting up Video Graphics Array(VGA) and drawing some basic shapes by ploting pixels.

Tic-Tac-Toe a simple tic-tac-toe DOS game with boxes, Pong-Game using graphics

Requirements :-

(install following packages using apt-get)

  1. GNU/Linux :- Any distribution
  2. make :- make utility
  3. Nasm :- NASM Assembler(nasm)
  4. GCC :- GNU Compiler Collection, C compiler
  5. xorriso :- A package that creates, loads, manipulates ISO 9660 filesystem images.(man xorriso)
  6. grub-pc-bin: GRUB binaries and modules
  7. mtools: utilities to access DOS disks in Unix
  8. grub-mkrescue :- utility to make ISO image
  9. QEMU :- Quick EMUlator to boot our kernel
  10. VirtualBox :- A full graphical virtual environment
$ sudo apt-get install make nasm gcc grub-pc-bin mtools xorriso qemu qemu-system virtualbox

NEW KERNEL

A new modified source code has been added to "NEW KERNEL" directory. Compilation scripts are replaced with Makefile. Assembly code is replaced with NASM assembly rathen than GNU AS.

Order

  1]   Console
  2]   GDT
  3]   IDT
  4]   TSS
  5]   Keyboard
  6]   Terminal
  7]   Timer
  8]   Mouse
  9]   FPU
10]   Memory Info
11]   Physical Memory Manager
12]   KHeap
13]   Paging
14]   ATA read/write
15]   BIOS 32
16]   VGA
17]   VESA VBE
18]   Bitmap Text

os's People

Contributors

ashp0 avatar pritamzope avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

os's Issues

Add Filesystem

We can make a atapio driver, and then implement a vfs or smth.
First implement:

  • atapio_read and atapio_write
  • Then make a read-only filesystem maybe.
    Thanks

TicTacToe: box.o:(.bss+0x0): multiple definition of `vga_buffer'

At execute:

./run.sh

Result:

box.o:(.bss+0x0): multiple definition of `vga_buffer'
kernel.o:(.bss+0x4): first defined here
tic_tac_toe.o:(.bss+0x18): multiple definition of `vga_buffer'
kernel.o:(.bss+0x4): first defined here
grub-file: error: cannot open `TicTacToe.bin': No such file or directory.
cp: cannot stat 'TicTacToe.bin': No such file or directory

Versions:

  • GNU assembler version 2.26.20160125
  • GNU bash, version 5.0.17(1)-release (x86_64-slackware-linux-gnu)
  • gcc (GCC) 10.2.0
  • GNU ld version 2.26.20160125

@pritamzope, how can i load PE?

@pritamzope, Please help me in loading some executable format like PE, ELF and others from kernel. Please help me with code. I have no idea on that.

I want to run apps inside my kernel.

Please help me fast!

Using malloc and converting to 64bit

Hello,
Before anything else, thanks for the videos and this repo, awesome work!
I managed to compile, print/read ints/strings and draw graphics.
But now I want to convert the OS to 64bit, also when horsing around testing stuff, I tried using malloc and even though I have included stdlib.h I get : "....c:(.text+0x602): undefined reference to `malloc'
"
this is where I am trying to use malloc

`typedef struct _POINT_
{
    unsigned int x;
    unsigned int y;
}_POINT_;


struct _POINT_* POINT(const unsigned int _x, const unsigned int _y)
{
    struct _POINT_* point = (_POINT_*)malloc(sizeof(struct _POINT_));

    if(point)
    {
        point->x = _x;
        point->y = _y;
    }
    return point;
};`

Also can you provide more detail/reading material different than wikipedia on how vga_entry(...) works?

Scrolling Screen

Idk for the terminal why the screen isn't made to scroll.... Zeroing out the line buffer should be enough.

Error occur when I'm compiling the .asm file

Hello, I have an error while compiling the .asm file to .bin or .iso
This is the error:

WinOS.asm:161: error: TIMES value -5 is negative

I downloaded your source code of the Hello World Extended OS Version in your blogger site. And the error occur in this line:
;/////////////////////////////////////////// ; boot loader magic number times ((0x200 - 2) - ($ - $$)) db 0x00 ;set 512 bytes for boot sector which are necessary dw 0xAA55 ; boot signature 0xAA & 0x55

Please help because, I cannot convert it into .iso or .bin. Linux Distro: Linux Mint Cinnamon 19 Thank you.

How do I create a bootloader that loads the OS

I know I need to enter Protected Mode etc. but I don't see any code when I lookup on the web. Can someone give a sample code of a full bootloader in Assembly? Also, I was using GRUB, but I want to create my own. I need to load an elf_i386 file.

Run in 64-bit long mode

Thank you for your project. Which has provided me with great help.

But, Have you thought about implementing an operating system that runs in 64-bit (long mode)?
Maybe it can be more modern. Contains SMP, process management, and VFS.

This will be very interesting.

Bitmap lower-case rendering issue

In /VGA/Bitmaps/kernel.c when I try to draw bitmapped lowercase letters on the screen the letter does not display, when using the draw_string() function. I understand this is because there is no definition for lower-case letters in bitmap.c but I don`t know how to make the definitions - there is no page I have found so far on the internet explaining how.

x86 Calculator error in Assembly and some disk errors

This

;******************************************
; botloader code begin

[bits 16]           ; tell assembler that working in real mode(16 bit mode)
[org 0x7c00]        ; organize from 0x7C00 memory location where BIOS will load us


start:              ; start label from where our code starts


  xor ax,ax           ; set ax register to 0
  mov ds,ax           ; set data segment(ds) to 0
  mov es,ax           ; set extra segment(es) to 0

  ;******************************************
  ; jumping from rel mode to protected mode
  ; by using disk interrupt

  mov ah, 0x02        ; load second stage to memory
  mov al, 0x10        ; numbers of sectors to read into memory
  mov dl, 0x80        ; sector read from fixed/usb disk
  mov ch, 0           ; cylinder number
  mov dh, 0           ; head number
  mov cl, 2           ; sector number
  mov bx, _start      ; load into es:bx segment :offset of buffer
  int 0x13            ; disk I/O interrupt

  ; before jumping clearing all interrupts
  cli

  ; jump to protected mode
  jmp _start                 ; jump to second stage

  times (510 - ($ - $$)) db 0x00     ;set 512 bytes for boot sector which are necessary
  dw 0xAA55                          ; boot signature 0xAA & 0x55


; bootloader code end

;******************************************
; x86 code begin 

_start:

main : 

doesn't jump do protected mode. Theres no GDT in this code, an also, in protected mode you can't use bios interrupts.

Postdata: The disk reading code doesn't work on some emulators and computers, because CS isn't 0 ,you don't set the stack to 0x7c00, you musnt set dl to anything, you don't set bx to 0x7e00 and you don't jump to 0x7e00.

Hope this helps 😅
And to all frustrated people, here you are my bootloader that works anywhere: https://github.com/AtieP/AtieDOS/blob/master/bootloader.asm

Screen scrolling doesn't work.

Hello! I'm a big fan of your work, and noticed you added terminal scrolling.

I'm building my own OS using your Terminal project as a base.

However, compiling my own code and your code both still don't scroll.

I see you have added a method called terminal_scroll(), however, I do not see any calls of it in terminal's code.

I hope to see this fixed, love your work!

Error on making `MyOs.bin`

According to the run.sh file in kernel_1 folder, when running this command:
gcc -T linker.ld -o MyOS.bin -ffreestanding -O2 -nostdlib kernel.o boot.o -lgcc
I get the following error:
/usr/bin/ld: boot.o: relocation R_X86_64_32 against '.multiboot' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status

could not read

could not read disk on qemu.
i view iso files and no binary on it only grub folder nd config file

Output more colors in the VGA palette

I have taken a look on the code "VGA/kernel_c/Simple/vga.h" and its what i was looking for graphics design, but i see they are predefined 16 colors when the resolution is 320x200 (known as 13h mode), so, i changed the color output and making changes up to 0 - 256 colors palette, instead of using the vga.h colors. But the colors are not displayed. How do i implement them, or its set up in mode AL = 0Dh, instead of AL = 13h?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.