/* This code is in the public domain. *//* Everybody can contribute regardless of how much of an asshole they are. *//* Please keep your lines at a maximum of 78 characters such that DOS *//* people can still edit the code without getting too angry. *//* Language used is ANSI C. Be sure to do bounds checking and never trust *//* any input from the user, and do check for NULL occasionally. */#include "kernel.h"void kmain(){ kprintf("Welcome to 8kernel!\n");
OK guys it's up to you now. Torvalds didn't write everything himself either, you know.
What if we just forked the kernel and converted it to new C standards and cleaned it up? All the work is already done for us, it just needs remade with more autism.
Noah Scott
Can we put that in our CoC?
Jacob Murphy
if (user->gender == NULL) { congratulate_user(user); donate_to_patreon(user, 20, US_DOLLAR);}
Aiden Lee
Great, now (((they))) don't even have to bother with getting rid of Linus and other maintainers.
Daniel Foster
user I...
I'm not a kernel nut, but what if we created a microkernel that gives a command line with the frame buffer? It would load instantly and allow a console only environment and shell with text prog&utilities like sed awk python. Would this be like extending grub with more software?
Jacob Miller
Last time I checked for Null a tranny went to his house to bark at his mother while he was hiding in the bathroom. How's the little fella doing anyway?
Ryan Perez
/* All contributions welcome. */
Grayson Brooks
let's do it in assembler so trannies can't read it
Gavin Collins
CoC: Contributors to this project must have an IQ above 115.
There, the end.
Hunter Walker
why don't we do a less micro-kernel like thing and instrad focus on efficiently utilizing mordern hardware, include more stuff in the kernel and reside to modules when it's really stuff most people don't need?
Luis Young
like extending grub...hmm... i have my problems with looking at that. but of course, at first you need to point the computer to the boot sector. but finding it won't automatically give you an unixoid enviroment. you'd have to port stuff lile bash first and implement what it needs to run. Porting PY is probably a big step from there. Let's not yet think about such userlandy things
Chase Rodriguez
OS DEV 101 Requirements: QEMU, C compiler (preferably gcc or clang), unix-ish OS for development, knowledge of x86 and C
Start by reading the GRUB Multiboot Specification at gnu.org/software/grub/manual/multiboot/multiboot.html Using the multiboot standard, your bootloader (GRUB or compatible; QEMU also supports this!) will 1. set up your CPU for you so you don't have to deal with ancient clutter such as the A20 gate and 2. boot right into an ELF file which you can build with common unix tools. TL;DR you need a special data structure somewhere at the beginning of your ELF kernel and in return your ebx register will point to a structure generated by the bootloader which contains useful information. The CPU will be in 286 protected mode (32 bit, segmentation, no paging (yet)).
For the bare minimum, you need a struct that contains the 32 bit magic number 0x1badb002, a 32 bit flags field which can be left zero, and a 32 bit checksum which is -(magic + flags). Make sure your structure is aligned to 4 bytes. The structure has its own section in the ELF file to ensure it is at the beginning of the file (more on this later). struct multiboot_header { unsigned int magic; unsigned int flags; unsigned int checksum;}struct multiboot_header header __attribute__((section("multiboot"), aligned(4))) = { .magic = 0x1badb002, .flags = 0, .checksum = -0x1badb002} Save as multiboot_header.c and compile with gcc -m32 -c -o multiboot_header.o multiboot_header.c
Also you need some you want to run. .section .text.global kmainkmain: movl $0x0474042f, 0xb8000 movl $0x04630465, 0xb8004 movl $0x042f0468, 0xb8008 hlt This loads a message into vga memory at 0xb8000. It will show up on the top left. Save as kernel.S and compile with as --32 -o kernel.o kernel.S
Finally, you need to link kernel.o and multiboot_header.o into a bootable kernel. You need a linker file: ENTRY(kmain)SECTIONS { . = 1M; multiboot : { *(multiboot) } .text : { *(.text) }} The line ". = 1M;" tells your bootloader to load the contents of the file to memory address 1 megabyte. The multiboot header comes first, then the code. Save as linker.ld. Link your code with ld -melf_i386 -n -o kernel -T linker.ld kernel.o multiboot_header.o
Congratulations! Now you have a bootable kernel. QEMU supports the multiboot format, so you don't need to install GRUB. Boot your kernel with qemu -curses -kernel kernel
Requesting that this important check will be added somewhere.
/* #define archX86 //enable when compiling for x86 */#ifdef archX86 __asm__("movl $0, %eax;" "cpuid;" ); register int ebx asm ("ebx"); //Genu register int edx asm ("edx"); //ineI register int ecx asm ("ecx"); //ntel if(ebx == 0x756e6547 && edx == 0x49656e69 && ecx == 0x6c65746e) { //Intel nigger monkey detected, exit return -1; } #endif
Andrew Jones
Sorry for messed up formatting.
My next goal in development is to figure out how to increment cpu clockspeed in order to beat Linux in performance and have a strong marketing talking point for our new kernel.
Jaxson Adams
(defun (y-combinator
Samuel Taylor
100% this
Benjamin Nguyen
Wtf are you all whining about? Are they blocking your contributions or giving you a taste of your own medicine? You liked who was in control before and now you don't. If you're alpha you can dismiss your feelings when they conflict with your ability to achieve goals. If you're beta you just follow.
"Hey, this is the Code of Conduct for all future software programming and collaborations for %s.\n\n
Please be nice to all people involved in the project and outside third party people involved in the project.\n\n
Don't break country laws of the nation where the project is hosted and avoid breaking laws for other peoples' nationalities involved in the project.\n\n
When commenting code in the project, remain professional and focus on the code and its improvement. Attacking a contributor using Ad hominem rhetoric and similar strawman techniques is not allowed.\n\n
Try to improve code from functional to efficient. Write comments for unconventional methods or confusing code, linking to proof that the coding convention is more efficient or how it works.\n\n
There are only two genders. If you have a vagina, keep it. If you have a penis, don't cut it off. What happens in your bedroom and local political electorate doesn't involve this project.\n\n
The only political ideology to strive for is freedom to operate software that can be audited, contributed, supported, improved, used by anyone involved without limitations and with open clear announcements of when we have failed to uphold freedom policy (such as when outsourcing, forking or employing other project developers or companies that do not uphold a freedom policy).\n\n
Try to remain anonymous for as long as possible before committing yourself to publicizing private information. The people involved in the project focuses on creation and improvement. Those that focus on destruction will be removed according to common sense from moderators.\n\n ", project_name,
Evan Martin
Gtfo statist
Justin Campbell
Linux and many other open source projects have required that you publish your name with your patches for a long time. See signed-off-by.me/ I don't know what made them require such a certificate but I'm sure they have their good reasons (or bad experiences in the past).
Jonathan Thompson
should we use a bash style shell or just feed everything into a c compiler like terry? Let's at least make zsh the standard shell!
Eli Baker
on the tech discord we already decided on fish as standard
Carson Long
Hmm haven't tried fish yet, I guessit wont hurt to install and try it this weekend. Don't be a tranny though and use irc instead of discord.
Benjamin Robinson
LOOOOOOOOOOOOOOOOOOOOOOOL Good one, Zig Forums! This wouldn't have happened with Rust :^)
Ryder Reyes
Infinite loops are blazingly fast. Is there any way we can synergistically incorporate this engineering feature with the fact that it will be called some flavor of 「infinity OS」 in the final shipped build?
Isaac Collins
CoalRollOS
Julian Reed
Public domain code is a VERY Bad idea.
Landon Baker
Why? Get your copyleft commie paws off my code, (((Stallman))).
Gabriel Watson
Dedicating to the public domain is bad. This should be GPLv3
Nathan Brooks
and so the war began and no actual work got done. The end
Chase Adams
Change it to 130 and call it SpectrumOS
Daniel Ward
Who gets this to switch to long mode? Paging, anyone?
Caleb Gutierrez
If it can be subverted so easily, what is the point?
I'd rather work on a proof verified RTOS
Jeremiah Gray
I'm 99% sure he just copy and pasted from the osdev wiki.
Why would I copy and paste code for such a simple task from the wiki? Are you projecting? Look, I cannot prove anything here, nor do I want to, but you haven't done anything to even get the benefit of doubt. Chop chop, implement paging, filthy nocoder.
Samuel Martin
This is cool and all but where are the funny easter eggs? It should play a fart sound every time the tilde character appears onscreen.
Sebastian Stewart
i would like to humbly submit that we all support templeos.org/
Anthony Bennett
...
Angel Myers
Bump. Are there even less actual coders here than I thought??
David Ramirez
sudo printf "Hitler did nothing wrong" /end #Am I a kernel now?
the great wall is the best that ever happened to non-chinks
Sebastian Perry
The great nu/pol/ cancerwave slowly destroyed old Zig Forums as waves of shitposting morons determined to turn Zig Forums into 4chan all over again began screeching at anyone who called them retarded newfags and did it in such large numbers that they eventually managed to successfully drive out most of the oldfags. Now the newfag cancer pretends to be the oldfags, and Zig Forums is mostly cancer. Although the nu/pol/ newfags were always trying to pretend to be oldfags, even though they blatantly post like 4chan cancer.
There's some hope for recovery now that Zig Forums is no longer run by insane retards that incubate these fucking nutters, but odds are those quality posters ain't coming back.
I'm a sysadmin I only know python and bash scripts lel
Isaac Brooks
ITT our valiant but sadly Zig Forumsthetic retards are once again thwarted by their own faggotry and uselessness. Tune in next thread and find out if they do it again!