a-darwish / cuteos Goto Github PK
View Code? Open in Web Editor NEWA 64-bit SMP-safe kernel for the PC architecture.
A 64-bit SMP-safe kernel for the PC architecture.
* What? ------- Cute! is a 64-bit SMP-safe POSIX-compatible kernel for the PC architecture. It's 'cute' in the sense of having the source code as simple and fun to work with as possible, hopefully without sacrificing performance. Throughout this project, a huge number of questions were (and are) asked to the great people at #osdev. Special thanks to: - Brendan Trotter (bcos), <[email protected]>, the BCOS project - Travis Geiselbrecht (geist), http://tkgeisel.com * Navigation: ------------- To begin your way throughout the kernel source, I'd recommend checking the freestanding isolated parts first. Begin with the `lib/' folder, which includes optimized C string methods, type-generic linked-lists, spinlocks, a printf() implementation, etc. Most of the kernel heavily-used idioms are included in 'kernel.h'; it'll be handy to have it open while checking the rest of the source. This kernel source is tracked by 'git' from day 0: if you'd like to know how to write a bootloader and a kernel from scratch, the git history (with its carefully written commit logs) should be very valuable. By now, you can go anywhere. ALWAYS check a module's header file BEFORE checking its code. Due to compilers inefficiencies [1] and C parsing semantics, a lot of details are put in *.h. Comments in the *.c files also assume reading such headers FIRST, unless otherwise stated. [1] To be fixed by GCC-4.5 `link-time optimization': constant folding, code inlining, and further analysis across separate object modules. README - this file. boot/ - early bootstrap code: a 512-Kbyte bootloader, assembly for jumping to C, code to jump to 'real-mode' and return back, the SMP trampoline, etc. lib/ - library: as stated above, freestanding components like C string methods, linked-lists (for stacks and queues), spinlocks, a printf(), etc mm/ - memory management: dynamic memory allocation and virtual memory. dev/ - device drivers: interrupt controllers, timers, keyboard, inter-processor interrupts (local APICs), etc kern/ - the rest: context switching, thread scheduling, BIOS table parsers, IRQ handling, system-wide panic(), etc. tools/ - userspace tools: Python-2.6+/3.0+ programs that generate gnuplot scripts out of the kernel scheduling statistics. * Influences? ------------- One of the MAJOR goals of this project is examining the current literature of Operating Systems in the process: - The page allocator is influenced by SVR2 buffer-cache lists, with tweaks for zoning and PC's sparse physical memory. - Dynamic memory allocation uses the McKusick-Karels algorithm originally found in 4.3-BSD. - Overall kernel coding style and APIs are heavily influenced by Linux-2.6. I used that style in the past, and I love it. - The scheduler MLFQ parameters are taken from Solaris, with influences from the FreeBSD ULE (2.0) scheduler. * Books? -------- Beside the datasheets, specifications, and research papers saved in our `references' git repository [**], below books proved to be tremendously helpful: - M. Bach: `The Design of the UNIX Operating System', 1986 That book is __perfect__ for understanding the basics. - M.K. McKusick and G.V. Neville-Neil: `The Design and Implementation of the FreeBSD Operating System', 2004 - J. Mauro and R. McDougall: `Solaris Internals, Core Kernel Components', first edition, 2000 - U. Vahalia: `Unix Internals, The New Frontiers', 1996 [**] http://gitorious.org/cute-os/references --Ahmed S. Darwish <[email protected]>
I'm trying compiler and exec this OS without sucess. I can compiler but not run. This is my script.
#!/bin/bash
RAMSZ=$1
RAM=" -m $RAMSZ"
QEMU="qemu-system-x86_64 "
BOOT_BIN="kern/image"
RAMDISK_BIN="build/ramdisk"
FINAL_HD_IMAGE="build/hd-image"
if [[ $RAMSZ == "" ]]; then
RAM=" -m 128"
fi
echo "qemu: ram = $RAM"
HD=""
KERNEL=""
SMP=" "
APPEND="-monitor stdio -no-reboot "
HD="-drive format=raw,file=build/hd-image,media=disk"
#HD="-drive format=raw,file=build/hd-image,if=ide,media=disk"
KERNEL="-kernel build/hd-image"
SMP="-smp 2"
#APPEND="-append "use_debug_port=1 root=769 loglevel=0 vga=1 use_acpi=1""
#APPEND=" -monitor stdio"
QEMUFLAGS=" -no-reboot"
QEMUFLAGS+=" -boot d "
QEMUFLAGS+=" -net none"
QEMUFLAGS+=" $RAM "
QEMUFLAGS+=" -smp sockets=1,cores=4,threads=1 "
QEMUFLAGS+=" -serial stdio "
QEMUFLAGS+=" -drive format=raw,file=build/hd-image,media=disk"
#QEMUFLAGS+=" -drive format=raw,file=boot/bootsect.bin,media=disk"
#QEMUFLAGS+=" -hda kern/image"
#QEMUFLAGS+=" -cdrom $(iso)"
#QEMUFLAGS+=" -hda HDOS-Lab.img"
#"CMD="$QEMU $RAM $SMP $HD $KERNEL $APPEND"
CMD="$QEMU $QEMUFLAGS"
echo "Running " $CMD
#echo $QEMUFLAGS
eval $CMD
How run it?
Hi, im trying to build cuteOS on macOS.
Here are the steps that i followed:
> git clone https://github.com/a-darwish/cuteOS.git
Output:
Cloning into 'cuteOS'...
remote: Enumerating objects: 1398, done.
remote: Total 1398 (delta 0), reused 0 (delta 0), pack-reused 1398
Receiving objects: 100% (1398/1398), 406.94 KiB | 309.00 KiB/s, done.
Resolving deltas: 100% (996/996), done.
> cd cuteOS/
> ls
Output:
Makefile TODO dev/ include/ lib/ tools/
README boot/ ext2/ kern/ mm/
> make
Output:
MKDIR .deps
MKDIR .deps/boot
MKDIR .deps/mm
MKDIR .deps/dev
MKDIR .deps/ext2
MKDIR .deps/lib
MKDIR .deps/kern
AS boot/bootsect.o
warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'?
[-Wunknown-warning-option]
warning: unknown warning option '-Wnormalized=nfc'; did you mean
'-Wformat-pedantic'? [-Wunknown-warning-option]
2 warnings generated.
boot/bootsect.S:384:6: error: invalid .org offset '510' (at offset '65622')
.org 510
^
boot/bootsect.S:349:8: error: expected relocatable expression
.long MBR_SEG<<4 + gdt # NOTE! protected mode flat address
^
boot/bootsect.S:384:6: error: invalid .org offset '510' (at offset '65622')
.org 510
^
make: *** [boot/bootsect.o] Error 1
I tried to build the project but this error stopped me.
https://github.com/smalinux/smalinux.github.io/blob/master/_/temp-1.PNG
ld: i386:x86-64 architecture of input file 'boot/bootsect.o' is incompatible with i386 output make: *** [boot/bootsect.elf] Error 1
I'm using Ubuntu 14.04
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.