#⌨coders-cave

1 messages · Page 79 of 1

orchid frigate
#

and setting this language up for os dev is...insane

#

it means you cannot run any code

#

you cant use std

#

in any projects

#

and all you can do is write code which you compile

hasty bane
#

so youre just working with the basics

orchid frigate
#

oh and you cant use main

hasty bane
#

hold on

orchid frigate
#

so you gotta make your own starting function

hasty bane
#

wait

orchid frigate
hasty bane
#

how do you make a main function

#

and why

#

what makes a function launch at the start

orchid frigate
#

Its a very long process but Im gonna give you the basics of how you start a kernel

hasty bane
#

🤔

#

o

#

ok wait

orchid frigate
#

basically the first file to be booted on a pc is BIOS, everyone knows that

hasty bane
#

ye

orchid frigate
#

Afterwords the bootloader is called

#

the thing that calls the kernel of the os

#

I can make bootloaders

#

They are pretty simple

#

if you know basic assembly

hasty bane
#

🤔

orchid frigate
#

anyway, after the bootloader moves from 16 bit to 32 bit

#

it can call the kernel

#

which has to be a C function

hasty bane
#

wbeyes2 why does it start in 16 bit

#

and why is everything C

#

is that hardwired?

orchid frigate
hasty bane
#

interesting

orchid frigate
#

the OS has to move to 32 bits and 64 bits

hasty bane
#

so you can do a 16 bit is

#

os

orchid frigate
#
[bits 32]
[extern _start]
call start
jmp $
orchid frigate
#

because it will be completely useless

hasty bane
#

fair :D

orchid frigate
#

and will only be able to hold 1kb of memory which is itself

hasty bane
#

lmao

#

chadOS

orchid frigate
#

I actually have a 16 bit OS made

#

its only a bootloader

#

and has a shell

#

working shell

#

The thing is 16 bit assembly is easy because BIOS is like a library

hasty bane
#

huh

orchid frigate
#

it does everything for you

hasty bane
#

so

#

assembly is different?

orchid frigate
#

like writing, reading etc.

hasty bane
#

16->32->64?

orchid frigate
#

very very very different

hasty bane
#

why

orchid frigate
#

16 bits is the easiest

hasty bane
#

is 64 bit very hard

orchid frigate
#

least ammount of registers to remember and has BIOS interupts enabled

#

32bit is easly the hardest

#

Its...cold

#

and empty

hasty bane
#

why 32 bit and not 64 bit

orchid frigate
#

once you move into 32bits, the computer is like a corpse

#

nothing is initiated

#

nothing works

hasty bane
#

lmao

orchid frigate
#

even the processor doesnt work

hasty bane
#

the windows xp experience

orchid frigate
#

the os kernel has complete control over the pc

hasty bane
#

oh so

orchid frigate
#

and basically has to bring life to it by initiating drivers

hasty bane
#

16bit is on autopilot?

orchid frigate
hasty bane
#

hmmm

orchid frigate
#

Reading the disk would take hundreds of lines worth of drivers in 32bits and 64bits

#

while in 16 you use a BIOS interupt to do it in 20 lines

#

btw interupts - functions which are rarely used by the pc because they block all other processes from existing so that they can run

hasty bane
#

why isnt that a thing for 32 bit and up

#

o

#

ohh

#

i see

#

16 bit is so tiny

#

that it doesn't matter

orchid frigate
#

they are usually used to handle kernel errors in 32 and 64 bits

hasty bane
#

but 32 bit and more

#

you gotta use all that SPACE

orchid frigate
hasty bane
#

🤔

orchid frigate
#

but UEFI assembly is complex af

#

it uses multiboot and multiboot2 to boot instead of a bootloader

#

there are threads and stuff

hasty bane
#

its probably better though if it makes everything else easier, right?

orchid frigate
#

headers

#

its much less compatible

hasty bane
#

hmm

orchid frigate
#

and not all interupts are there

fair sundial
#

hello

hasty bane
#

hi

orchid frigate
#

plus BIOS systems can run on UEFI computers because UEFI has legacy mode

#

which makes UEFI behave like BIOS

hasty bane
#

oo

orchid frigate
#

hi

hasty bane
#

so bios is like

#

good.

#

kek

#

compatible

orchid frigate
#

It is but the problem with building an os is you gotta rewrite the bootloader for every manufacturer

#

for x86 systems you gotta use x86

#

assembly

#

for ARM you gotta use ARM

#

And idk what for Mac hardware

hasty bane
#

For Mac you don't write for Mac

#

rule 1 of good person: be actively hostile towards Apple

orchid frigate
#

ok so it uses ARM

hasty bane
#

dang

orchid frigate
#

but a heavily modified version of it

#

Also you know whats fun about making an OS?

#

Going into a high level language like C and realising

#

Jesus Christ low level C is harder then assembly

#

like ima show you some basic low level C code from a kernel

hasty bane
#

you know you're insane enough for OS development when you start considering C high level

orchid frigate
#

if it isnt assembly its high level

#

but that doesnt mean its easier

#

in fact it may be harder

#

in the start that is

#

oh and btw

hasty bane
#

danm

orchid frigate
#

you gotta implement the entire standard library yourself

hasty bane
#

imagine writing a game entirely in assembly

orchid frigate
#

let that sink in for a moment

#

everything

orchid frigate
#

from macros to functions

hasty bane
#

just copypaste it??

orchid frigate
#

it wont work

#

lemme explain why

hasty bane
#

ye pls do

orchid frigate
#

basically so to write to screen you the standard library provides a command

#

println!

#

which I have implemented in rust

#

But behind this command hides the vga_buffer driver

#

lemme show you some pics of it

hasty bane
#

hu h

#

so

#

std

#

relies on other stuff

#

yes?

orchid frigate
#

This is a very minimalistic driver but it works

orchid frigate
#

but some macros require you to give it some info

#

like println! requiers you to give it a destination or an info struct to work

#

called a writer

hasty bane
#

hmm

orchid frigate
#

Its alot of work and its definetly not worth it

#

but its fun

#

and rewarding

hasty bane
#

kek

orchid frigate
#

also the ASCII table exists which uhhh...\

#

search ASCII hexadecimal and look at the results

#

in the past you had to remember it

hasty bane
#

uhhhhhmmmhhh

barren shale
#

apple is being a good boy

hasty bane
#

impossible

bold rover
#

@barren shale Help

#

Nvm

main brook
#

eh-

#

vector is a linked list

#

meaning its mutable and dynamic

#

deleting, adding is fast if you know the index

#

linked list are good for dynamic data which you don't have a definite maximum elements

#

but its also takes more memories

#

because it has to carry additional data to each block

#

same

#

nice

#

i made my first calculator after a month

#

there's this

#

that sounds a bit weird

#

but i would like it if you call me onee sama

#

:intense_licking:

bold rover
main brook
#

@orchid frigate you're on windows right now?

main brook
orchid frigate
main brook
#

im just asking

#

also

#

try gitbash

#

it has some unix command installed in it

#

i don't know if it has chroot though

orchid frigate
#

I use cygwin but it, for some reason, cut off some unix commands which I need

#

like grub support

#

hi there

#

cool

#

what game engine

#

nice

#

Thats fine I didnt write anything in the start either

main brook
#

me neither

orchid frigate
#

But look at me now I write trash code that barely works for projects that dont have a meaning

#

I understand that mine also isnt amazing

#

I can try to explain them to you if you want

#

Ah cpp my fav language below assembly and rust

#

ok uhh give me a moment

#

cuz im kinda in online class

barren shale
#

a vector is a list

#

the

#
list<int> i = { 1, 2, 3};
#

is a linked list

#

yes c++ isnt confusing at all

hasty bane
#

damn rust is cool

main brook
#

it is

#

very cool

hasty bane
#

wbshy time to do stuff

orchid frigate
#

That doesnt really matter

#

but vectors

#

they are very simple

hasty bane
#

vectors is when direction wbshy

orchid frigate
#

basically variables that hold three values usually ints or floats

orchid frigate
hasty bane
#

cringe!

orchid frigate
#

they are only useful in gfx APIS

#

and void is a function

#

that returns (), or nothing

#

thats different from returning absolutely nothing

#

but that doesnt matter

orchid frigate
hasty bane
#

uhh

#

scary

#

but also cool

orchid frigate
#

alright now ima suggest you something

#

dont use the official cook book

#

its complex af

hasty bane
#

fair

orchid frigate
#

and the examples are cringe

hasty bane
#

links to alternatives? wbshy

orchid frigate
#

like incredibly difficult to understand

orchid frigate
hasty bane
#

fair

#

imma start by making a calculator

orchid frigate
#

when you get used to basics start implementing crates

hasty bane
#

👍

orchid frigate
#

damn, its actually slower then my vulkan api project

knotty root
orchid frigate
#

but I guesst thats an emulator so

#

doesnt use hardware at full

knotty root
#

Working hard haydot?

orchid frigate
#

yep

knotty root
#

Good! I won't disturb u. Please have good day

orchid frigate
#

Thank you! I hope you have a great day too!

knotty root
#

Thx!

orchid frigate
#

No there are many

#

The main ones are

#

int float bool string (only through a special header) char const char* (behaves as a string)

#

U_int8

#

And all other u_ints

#

its not a data type

#

ok but please dont say stuff like that

#

when you say

public void foo(){

}
#

this means that this function should return ()

#

meaning nothing

#

there are other functions

#

like

#
int main(){
  return 0;
}
#

this one in contrast has to return something

#

or an int

#

in this case

barren shale
main brook
#

int, float, bool, char

#

built in datatype

orchid frigate
#

legends say he never finished that sentence

orchid frigate
#

you have so much more to learn

#

in cpp

#

it takes month, if not years to learn language especially low level like cpp

#

think of an idea on what you want to do

#

make a project

#

realise you cant code and search for the answers of your problems

#

what was it

#

Yes but you have to know how to fix it

#

when you see this, do you understand whats wrong?

#

[Linker error] c:/crossdev/src/mingw-w64-svn/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain@16'

#

this is an error I used to have

#

or not this exactly but still it was a linker error

#

I dont expect you to have seen it either linker errors are rare but really difficult to fix

#

they mainly acquire when you use an API or something that requires to be linked with cpp

main brook
#

i think the best way to like

#

learn and use that knowledge to another language

#

is to know fundemental

#

concepts

#

and similar stuff

#

since its about problem solving

barren shale
#

it might change a bit if you change the type of programming language you are using

#

haydot is like 16

potent kite
#

who make bote

#

i am a dev of a bot named nova

barren shale
orchid frigate
#

im thinking about it but considering what im doing rn I dont know if I will get a job in a company

#

Not many companies want OS devs

barren shale
orchid frigate
#

So in the future if I have to I will have to make my own

barren shale
#

apple and microsoft

#

and it wont be in assembly

bold rover
#

Literally

#

Big G

#

Google

#

@orchid frigate Or just help on development of Linux

#

But you won't make money,But You get social status :chad:

barren shale
bold rover
#

loooooool

tropic hornet
#

What code is used in WorldBox?

#

Like the type

main brook
#

what

#

we had people asking what language is worldbox made with

#

but "type"?

tropic hornet
#

Yeah language sorry

main brook
main brook
bold rover
main brook
#

sadly i can only pronounce words not understand characters

#

oh look at that

#

its time to migrate my data

orchid frigate
#

but idk group projects like that suck

#

I wanna make something brand new Linux like

#

there shouldnt be only 3 main OSs

bold rover
#

Well who knows you can obviously help and Contribute👀

orchid frigate
#

which will most likely take another year

#

as gathering info on how a kernel and drivers work is insanely difficult

bold rover
#

Then start flexing your knowledge

#

You can do it! Nonetheless take your time

orchid frigate
#

Thank you for your words of encouregment, a big contrast to Hamza's words of..

#

your mom

#

Thats the best way to describe how he speaks

red urchin
main brook
main brook
#

make a Unix based system

#

instead of forking from linux directly

#

and bam

#

original

barren shale
#

that's macos

main brook
#

macos are literally that

#

except its for apple

#

specifically

hasty bane
orchid frigate
main brook
#

well okie

orchid frigate
#

I know im setting my goals too high (even if I assemble a team in the future it's still alot of work) but I want the code to be written by me and my team from the bootloader to the...end of the kernel

#

But first I gotta figure out how tf keyboards work

main brook
#

they send a signal to the bios

#

with a data

orchid frigate
#

Why the BIOS

main brook
#

because its external device?

#

and from bios to the cpu

orchid frigate
#

Well like keyboards are somewhere in memory

main brook
#

eh?

orchid frigate
#

You get where they are in memory and...use interupts?

#

Wait no interupts dont exist yet

orchid frigate
#

Alright well here go another 200 hours of reading about keyboards

main brook
#

well they raise an interrupt

#

you need to watch for it

orchid frigate
#

Ah I think I understand

#

So thats why the wiki said interupts should be made before keyboard driver

main brook
#

yes

orchid frigate
#

So the keyboard sends an interupt and maybe through that interupt it also sends some info like keyboard status

#

In some register

#

Probably the 32bit version of al

#

And you can extract it

#

Seems...too simple

#

Like the vga buffer was way more difficult

main brook
#

i need sleep

#

its almost 2am

#

and time is getting disorted

#

everything is either faster or slower

hasty bane
#

lmao

#

i decided to not learn rust rn

#

because i already have a lot of things to do

orchid frigate
#

What happened

hasty bane
#

nothing

#

i just figured it's gonna be very inefficient

#

to learn rust while doing a different thing

orchid frigate
#

Ok fair enough

hasty bane
#

ye

orchid frigate
#

I think I found the error to why the kernel OSs werent loading before and its the stupidest shit ever...

#

if this is the case im leaving programming for a week

#

I have had enough

orchid frigate
#

you know what I will check tommorow im worried my tired heart wont be able to accept my stupidity

#

It makes sense...so the problem was most likely that I booted from the wrong disk

#

4 LETTERS!!! CAUSED MONTHS OF PAIN

#

i hate programming but I love it

hasty bane
#

lmao

main brook
#

my db running smoothly

#

but the freaking owner decided to made a bug because he deleted a channel

#

now my code can errors because the channel doesn't exist

#

NoneType has no attribute .mention

young elkBOT
#
Now playing

American Football - Stay Home

median flare
#

oops

barren shale
#

but ok

orchid frigate
#

you dont know for how long I have been reading about OSs

orchid frigate
main brook
#

yes

orchid frigate
#

does he atleast pay you

main brook
#

i think the right word is

#

"delay"

#

well there's like

#

unix and windows way

#

there's the

#

usleep

#

for unix

#
#ifdef _WIN32
#include <Windows.h>
#else
#include <time.h>
int nanosleep(const struct timespec *req, struct timespec *rem);
#endif
#

the execution

#

exactly

#

well there's this

#

don't ask me to step on you again

#

i have a great plan for my luau event loop

barren shale
#

Lua xdddddd

main brook
#

nice my selector worked

#

now i can bind roblox things

#

to my event loop

#

its similar to running in a different thread

#

because its handled by roblox task scheduler

#

not my event loop

#

i can literally make this work

#

yay

thorny stone
#

I got good code ALT F4

knotty root
thorny stone
#

You monster

knotty root
#

I wonder tho how do I compile modsys w/ python

knotty root
thorny stone
#

YOU TURNED ME INTO A POTATO!

knotty root
#

😎

orchid frigate
#

I respect it no matter what

thorny stone
#

Bruh I got a admin

orchid frigate
#

Mod*

orchid frigate
#

I cant recommend anyone for helper

#

I mean I can but the recommendation has to be real

#

Plus I highly doubt you will be promoted if you are not a bear atleast

orchid frigate
#

thats cool but like you cant help people for a couple of days only and expect to be promoted

#

it took me months of being active to get a chance of becoming a mod

main brook
#

i helped people for like 2 years

barren shale
#

smh my head

swift charm
#

y que tiene

hasty bane
#

not for helper

#

helpers r like

swift charm
main brook
#

i didn't get paid enough to think too hard

#

about a feature im about to add

#

imagine wasting like 3 hours

#

on a feature

#

and then do a git restore .

#

because you think the feature sucks

orchid frigate
#

Sounds like something that would happen to me

knotty root
#

Joe mam door?

barren shale
knotty root
#

Ik ik

#

I thought I had my status say afk

#

What door

barren shale
#

it was for testing

#

i didnt want just a brown square

#

but that's okeh

#

still adding features

#

game is gonna take 5 years at this rate

#

i dont have a lot of free time these days

hasty bane
#

sometimes you just

#

invest too much time into smth bad

barren shale
#

until further notice

knotty root
#

Yes

#

Contact me if u need something done

#

Because I will totally do it, totally

barren shale
#

when i get some free time

#

we can get on a call

#

talk about it a bit

knotty root
#

💀

orchid frigate
#

OMG IT WORKED

#

it boots

#

I spent way too long for this but I finally got a working bootloader + kernel

orchid frigate
#

ok uhh somehow I made the CPU triple fault in qemu

#

Which is weird

bold rover
#

Wait

#

The position is still open?

main brook
#

isn't it now called

#

"meta"

bold rover
#

Yup

#

But the company company Facebook

#

Is still FB

#

Like what google did

#

Alphabet

main brook
#

ah

barren shale
#

nah

#

none does that

#

you will get 150k at most

main brook
#

this is what i ended up with

main brook
#

wohoo

#

im done

#

with the project

#

the rest will be extensions

#

the core is already good

#

A News Broadcast Bot for an Growtube

main brook
#

what

#

you mean like

#

read user keypress?

#

well its quite complex if its a cli app

#

well i mean

#

you can just

#
string input;
string start = "start";

cin >> &input;

if (input == start) {

}
#

or something similar

#

now i forgot if it was a pointer

#

or not

#

let me try actually

#

brb

#

oh it doesn't take in the pointer

#

but anyway

#
#include <iostream>


int main() {
        char name[20];
        std::cin >> name;
        std::cout << name << std::endl;
}
#
u0_a615@localhost:~# g++ test.cpp -o test.out
u0_a615@localhost:~# ./test.out
hi
hi
u0_a615@localhost:~#
hasty bane
#

Yes

main brook
#

github vscode

#

there's also termux

#

run a distro in proot

#

install a vncserver

#

and install xfce4

#

install web browser

#

download vscode

#

install it with package manager

#

you can access your vncserver from VNC Viewer

#

from google play store

hasty bane
#

termux is

#

basded

main brook
#

I MIGHT CONSIDER

#

using zsh instead of bash

#

due to its customizable behavior

#

but for now it looks shit

hasty bane
#

what is zsh

#

is it like zamn

main brook
#

cool shell prompt i have here

main brook
#

similar to bash

#

but more customizable

hasty bane
#

sus

main brook
#

it has more features in some cases

#

and very good

#

quite fast too

hasty bane
main brook
main brook
#

its fast reliable and interactive

#

i did not regret this

hasty bane
#

i feel inclined to make a tiny programming language for a shitpost

#

call it suslang and make everything an among us reference

#

base it on python and keep it interpreted so the speed is horrendous

main brook
#

hm

#

an interpreted language

#

made with an interpreted language

hasty bane
#

yes

#

stack the lag wbshy wbshy wbshy

orchid frigate
orchid frigate
#

😔

#

thats gonna take like

#

10 seconds to compile

#

a hello world script

main brook
#

well no

#

depending on your parser actually

#

but usually parsing string in python isn't that slow

#

plus python already have your code cached

#

so it'll run a bit faster if unchanged

bold rover
#

No

main brook
#

that's cool and all

#

but this is a cave that is mostly about codes

#

not arts

#

unless you're making a super readable code and it still works

#

that's art

exotic vessel
#

Ah yes... The nerd cave (character devolopment never happend)

main brook
#

that's hamza

#

most of us experienced development

#

like haydot with his bootloader

#

hamza is probably still here making "your mama" joke

main brook
#

my ears

#

also please don't

#

send that here

cosmic imp
#

Why

#

@knotty root wbeyes

main brook
#

that's not the point

#

you destroyed our ears

noble plank
#

codestroll

winged quail
#

e

#

lvl1 v

orchid frigate
#

you know what

#

fuck it

#

assembly kernel

#

because C kernel is impossible

#

The function wasnt running because I never called the function...

#

I need a fucking break lmao

#

ITS DONE

#

I LINKED IT

#

LES GOOOOO

#

THIS IS AMAZING

#

IT WORKS!!!!

#

I have never been so happy to see xone in my life

#

this was exactly me when I saw xone instead of "triple fault"

soft cedar
#

Helo me

orchid frigate
#

hello you

#

alright this is now one of the biggest projects I have ever worked on

#

Actually I may have had some bigger projects in unity but still

#

All this barely works its all assembled and ran through a make file which is complex as shit

#

I dont understand most of it but still

green acorn
#

Hello I would like to know how do I make a custom world

orchid frigate
#

uhhh

#

wdym

#

also

#

I forgot how amazing programming in a high level language is

#

and how amazingly dead this chat is

orchid frigate
#

Eh I used to make games

#

not anymore

#

Im making an os rn

#

But you can still help me with sprites

#

bro why tf did this code just print amogus

bold rover
orchid frigate
#

Actually I have beenn thinking about doing a similar concept

#

But its too complicated

#

Otherwise it would be one fast game

main brook
#

my storage devices are neat

#

i have like 249G and 14G

#

also for some weird reason

#

/dev/sdb1 had weird 4 partition

#

i had to format it back to fat32

main brook
#

@orchid frigate guess what

#

i fucked up my mounts

#

i accidentally mounted devtmpfs to /mnt/sdcard/dev

#

so /dev is literally almost empty

#

you can't do shit in it

#

i had to restart my rpi to let it remount

orchid frigate
#

reminds me of when I destroyed my usb

main brook
#

heh

unkempt dragon
main brook
#

i use it to host my stuff

#

i don't code there

#

i mostly install packages and run stuff there

unkempt dragon
#

just get an aws server lol

#

or some kind of bare metal server

#

don’t rpis max out at like 8GB ram

main brook
#

no?

#

im not that rich to pay a monthly payment of not my own machine

unkempt dragon
#

yeah but like come on

#

it’s an rpi

main brook
#

id rather not have any liability

main brook
unkempt dragon
#

you have more liability with your own stuff

main brook
#

i live with my parent

unkempt dragon
main brook
#

eh-

#

i mean not really its

#

an embeddable computer

#

small computer

#

i also have full access to my whole system

#

i can choose what os to use what package to add

unkempt dragon
#

ok how long does it take to install stuff though

main brook
#

edit my system to my liking

unkempt dragon
#

it can’t be that fast

main brook
#

its not a definite answer

#

if something needs more work than just putting files

#

its bound to take some times

#

like compiling

unkempt dragon
#

Check dms

#

I don’t want to clog up this channel with me fighting you on this

main brook
#

so you have the intention to fight with me?

#

im literally just minding my own business

unkempt dragon
#

nah now I want to prove you wrong though

orchid frigate
bold rover
#

I feel like this is Hamza #2

#

@main brook Ignore themtortongue

main brook
#

nah its fine

#

they're friendly

orchid frigate
#

i mean

#

you aint wrong but you also aint right

#

I respect people who do stuff in unity because they can actually make something

#

while im sitting here with my 20 files of assembly code to write X to the screen

main brook
#

i meant the latter part

#

you make your own graphic api

bold rover
orchid frigate
hasty bane
#

rpi good

orchid frigate
#

WAY too complicated and I can just use vulkan

#

which is already really difficult

main brook
#

nice

#

my phone doesn't support vulkan

orchid frigate
#

Oh wait no I just realised

main brook
#

it uses OpenGL3.1 though

orchid frigate
#

vulkan most likely wont work on the os

#

no std

#

uhhh...

hasty bane
orchid frigate
#

its also fun to code

hasty bane
#

be like terry davis

orchid frigate
#

but its slow and old

hasty bane
#

write everything

#

from scratch

main brook
#

duh

orchid frigate
#

My own BIOS

main brook
#

OpenGL is old tech

#

now Vulkan good

#

its weird though that

#

my old xiaomi phone

orchid frigate
main brook
#

support Vulkan

#

it was like 5 years ago

orchid frigate
#

You have to do everything yourself

#

Atleast it searches for your gpu but I dont even know if the low level version does that

hasty bane
#

low level is like high level just lower

orchid frigate
#

graphics is bad noone likes graphics

hasty bane
orchid frigate
#

terminal is better

main brook
hasty bane
#

tkinter gave me brain aids

#

i want PIXELS

main brook
#

bleh

#

use kivy

orchid frigate
#

Wait I just had an awful idea

main brook
#

what is it

hasty bane
orchid frigate
#

I make all the graphics with ASCII

hasty bane
#

i dont really need it though

orchid frigate
#

all icons

main brook
#

eh

orchid frigate
#

background

hasty bane
orchid frigate
#

desktop

hasty bane
#

it works tho

orchid frigate
#

Its not gonna be fun

#

But who cares ASCIIOS

hasty bane
#

call it dwarfos

#

:D

#

make sure to port DF

orchid frigate
orchid frigate
#

C is hard

hasty bane
#

is it hard or is it long and boring

orchid frigate
#

Its unsafe

#

because you dont know if your code is bad

#

or your compiler is bad

#

or assembler

#

or linker

#

or emulator

hasty bane
#

hmm

#

true

orchid frigate
#

The most you will get as an error is your emulator telling you there has been a triple fault or it flashing

#

meaning triple fault

hasty bane
#

🤔 what is a triple fault

orchid frigate
#

and triple faults are....

hasty bane
#

something fails 3 times?

orchid frigate
#

awful

#

Basically there are some thing the CPU cant do

#

like divide by 0

hasty bane
#

On the x86 computer architecture, a triple fault is a special kind of exception generated by the CPU when an exception occurs while the CPU is trying to invoke the double fault exception handler, which itself handles exceptions occurring while trying to invoke a regular exception handler.

#

lol based

orchid frigate
#

or access 0xfffffffffffffffffffff

#

the exception handler usually handles that if there is one

hasty bane
#

i tried to call an exception, but it failed, so i called an exception caller that calls exceptions for exception callers, but that also failed so im dead now

orchid frigate
#

if not an exception interupt handles that

#

if not

#

the cpu just kills itself

#

and resets

hasty bane
#

lel

orchid frigate
#

idk why but windows must be bad at handling exceptions

hasty bane
#

y

orchid frigate
#

because the blue screen of death has a lil expception at the bottom telling you what went wrong

hasty bane
#

🤔

orchid frigate
#

instead of fixing the issue

#

Like come on

hasty bane
#

i mean it cant fix the issue can it

orchid frigate
#

just end the task thats wrong ffs

hasty bane
#

not all issues at least

#

the issues that it can fix dont give you a bsod wbshy

orchid frigate
#

but im still salty

#

Also these handlers are very rarely used

#

because usually the OS never even allows them to exist and become tasks

hasty bane
#

imagine the amount of old code in windows

#

xdddd

#

theres probably stuff carried over from like
winxp

orchid frigate
#

like the calculator telling you you cant divide by zero instead of trying

hasty bane
#

yeah

orchid frigate
#

idk how to use windows to access undefined memory tho I wanna get a BSOD

hasty bane
#

you prob cant do smth like that

orchid frigate
#

With the exception "Why are you trying to access 0xyomama?"

hasty bane
#

could be abused by malware creators

orchid frigate
#

You can access BIOS memory through that

hasty bane
#

wbshy virus can do memes during boot

orchid frigate
#

And overwrite it

#

So pc == dead

hasty bane
#

kek

orchid frigate
#

wait I made an error

hasty bane
#

didnt chernobyl virus do that

#

fuck with bios

orchid frigate
#

nah the power plant exploded there

hasty bane
#

overwriting critical information on infected system drives, and in some cases destroying the system BIOS

orchid frigate
#

I mean deleting stuff like that isnt that hard

#

what is hard is getting the virus to the pc and making the user run it with admin permissions

hasty bane
#

yeah thats what antiviruses are for

orchid frigate
#

and not being detected my antivirus

hasty bane
#

when a virus has admin

#

its kinda too late to do a virus check

orchid frigate
#

And its also pretty useless

#

because, well you dont get anything

#

"Wow I destroyed this guy's pc im such a legend"

hasty bane
#

tbf

#

there could be uses

#

but it needs to be like specific

#

just a virus that goes around and breaks PCs isnt too useful

orchid frigate
#

actually nvm

hasty bane
#

but load that onto some corp network?

orchid frigate
#

its either impossible or insanely difficult

orchid frigate
#

the gdt and idt defend it

#

all memory that is important

hasty bane
#

makes sense

orchid frigate
#

gdt - global descriptor table

#

idt - interupt descriptor table

#

aka exception handler and interupt handler

hasty bane
#

wbshy haydot when r u gonna write virus

orchid frigate
#

pretty sure they dont allow tasks that are in certain memory space

hasty bane
#

chernobyl 2 when

orchid frigate
#

I will nuke my pc

hasty bane
#

at least its fun

orchid frigate
#

It is

hasty bane
#

and low level knowledge is very good

orchid frigate
#

what isnt is

hasty bane
#

for it

orchid frigate
#

trying to break and corrupt the descriptor tables

#

You have to know insanely well how they work and where they exist

#

basically here is the plan:

  1. Acess pc
  2. Corrupt gdt and idt
  3. Either divide by 0 or access some random memory space that doesnt exist like 0xdadadadadadaa
hasty bane
#

smh just mine crypto xdd

#

step 1 is probably like
as hard as step 2

#

if you want it to be efficient

#

and not just

#

"free money printing .exe"

orchid frigate
#

now that I think about it the pc has so much security

hasty bane
#

ofc

#

viruses have existed for decades

orchid frigate
#

dont forget step 3

hasty bane
#

wbshy not much morality in malware itself either

orchid frigate
#

its also hard

hasty bane
#

just

#

divide by 0

orchid frigate
#

because once again noone allows you to do these things

#

you cant

hasty bane
#

oh

orchid frigate
#

compilers dont allow you

hasty bane
#

tru

orchid frigate
#

assembly...idk about assembly

hasty bane
#

write assembly yourself?

#

yee

orchid frigate
#

pretty sure assemblers dont allow you

hasty bane
#

stupid cpu manufacturers

orchid frigate
#

calculator doesnt allow you

orchid frigate
hasty bane
#

just wreak havoc until everything breaks?

orchid frigate
#

you dont need much to break everything

#

ANYTHING could cause a triple fault

hasty bane
orchid frigate
#

Any click

hasty bane
#

then do it

#

brek da pc

orchid frigate
#

what the cpu will do is reset

hasty bane
#

sad

orchid frigate
#

so it will boot the os again

#

but

#

what would break it

hasty bane
#

delete every file :DDD

orchid frigate
#

is making this virus run on startup

#

so every time it resets

#

it triple faults

#

incredibly evil

hasty bane
#

trolling

orchid frigate
#

The OS is completely corrupted

#

But the windows OS devs have been making gdts and idts for...

#

a very long time

#

so they know what they are doing

hasty bane
#

wbshy yeah but the entire thing about hacking and viruses is that you only need 1 hole

#

and they need to patch every single one

orchid frigate
#

A virus like this could really be groundbreaking if it happened

#

and was possible

#

but naahh os dev better

hasty bane
#

it could exist at this very moment

#

tbf

#

just in the hands of nationstate actors

orchid frigate
#

you can break your pc without having to make malware

#

or atleast intending to make malware

hasty bane
#

hell yeah

#

sudo rm rf

orchid frigate
#

Now what would be really bad

#

is malware OS

hasty bane
#

wbshy sneak malware into a win10 update

orchid frigate
#

you see when the OS boots its in 16 bit mode

hasty bane
#

then take out the entire windows userbase with 1 click

orchid frigate
#

Meaning it has access to EVERYTHING

#

and thus can break anything

#

Worse? Malware BIOS

#

At this point just buy a new pc

hasty bane
#

kek

#

gtg

orchid frigate
#

Aight cya

orchid frigate
#

you know whats fun

#

opening a text editor

#

and trying to click on every line as fast as you can

#

you have to click once per line

hasty bane
#

huh

main brook
#

damn it

#

why is fish so tempting

#

im married to zsh

orchid frigate
#

Then unmarry zsh

#

And marry fish

main brook
#

fish shell be like

hasty bane
#

wat

main brook
#

zsh is

hasty bane
#

bash

#

fish

#

zsh

#

why so many

main brook
#

maybe ill marry all of them

main brook
hasty bane
#

sus

orchid frigate
#

Different shells are... different

main brook
#

bash, zsh, fish, ash, dash, csh

orchid frigate
#

Suprise suprise

main brook
#

there's alot more shell

hasty bane
#

spooky

orchid frigate
#

Some of them have different commands

main brook
orchid frigate
#

Or easier commands

hasty bane
#

i should mod rimworld

main brook
#

for running shit i use bash

hasty bane
#

i tried once

main brook
hasty bane
#

it was uhh

orchid frigate
#

Rimword

hasty bane
#

interesting

#

ngl

#

but

#

annoying

orchid frigate
#

The game that is too expensive