#OBOS (not vibecoded)

1 messages · Page 37 of 1

lean glen
#

just unrelated to programming

flint idol
#

Cool

lean glen
#

productive aka practicing guitar meme

flint idol
#

Anyway I will be back with news on this soon™️

#

About 3-5 pm EST

#

If I do rewrite the first thing I am doing is making a good naming convention

#

Rather, a better naming convention

#

Will probably just be snake case or smth

main girder
#

do the mica naming convention

real pecan
#

do astral naming convention

main girder
lean glen
#

the NT naming convention is pretty nice

main girder
#

the dollar signs mean its cool

flint idol
main girder
#

yes

timid elk
#

they are

lean glen
timid elk
#

serenityos and some other os uses sys$name for syscalls

main girder
#

this surprises ppl but its because of DEC who used $ everywhere and it was to avoid precluding using C on their OSes

main girder
timid elk
#

yep

main girder
#

i have no idea why they randomly use $ for that

timid elk
#

they don't need it

flint idol
#

Also maybe I will use a different language...

timid elk
#

they are literally cpp

#

they have namespaces

haughty abyss
#

yeah lol

haughty abyss
#

its nonstandard

real pecan
flint idol
#

Uh I also know C++

#

Unless I choose to learn zig

real pecan
#

if u do c++ u can use qacpi LETSFUCKINGGOOOOOO

flint idol
white mulch
flint idol
#

My naming convention might copy snake_case or be the NtNamingConvention

#

If I do rewrite of course

real pecan
#

whatever u do dont do tabs BlessRNG

haughty abyss
#

why? tabs are great

flint idol
#

Like the indentation thing?

real pecan
#

lmfao this discussion again

haughty abyss
real pecan
flint idol
#

Yeah

haughty abyss
#

tabs are objectively better because you can set it to what you want them to be as a user

flint idol
#

I am going to use spaces

haughty abyss
#

lol

real pecan
#

me 🙂

flint idol
#

I'll see what I will do

#

Also maybe this is all bait to get the obos thread alive because I am lonely meme

real pecan
#

anyway u can try zig

#

ig

flint idol
#

Sounds like C but on steroids

#

So I might as well use C in that case

real pecan
#

like C but your program gets optimized away

lean glen
haughty abyss
#

lol

flint idol
lean glen
#

zig sucks, I'd honestly just pick C

lean glen
real pecan
#

how

haughty abyss
#

yeah zig sucks

white mulch
#

I think I have tried zig like once, I don't exactly remember why I didn't use it more

lean glen
#

because

#

if its a firmware thing

haughty abyss
flint idol
#

Gtg now

lean glen
#

I could contribute

haughty abyss
#

would love contributors

lean glen
#

so it boots my OS

haughty abyss
#

so far i wrote a horribly overcomplicated print function

#

and some async shit

lean glen
#

we can use my libraries

#

library rather

haughty abyss
#

for DT? yeah maybe

lean glen
#

no for the general stuff

#

its like frigg

#

but better

haughty abyss
#

ah

real pecan
#

friggg

haughty abyss
#

#1311843641005703298 tho

lean glen
#

yk the rusty thing

timid elk
#

if you can't, your editor sucks

haughty abyss
#

space width is not a display option

timid elk
#

it is in my editor (doom emacs and very rarely vscode)

#

any good editor does it

#

detects indentation and makes it render as your indentation size

#

i believe even vim has it but my vim config is very barebones

#

all that matters is tabs are literally the worst thing ever

#

most stuff default to 8 em size tabs (e.g. github) and it's such an eyesore

#

and tabs weren't meant to be a fixed size

#

they align to the next multiple of 8

#

you're not supposed to make them 4 or 2 characters long

#

we have a tool for that, spaces

#

tabs have a specific reason to exist and there's no reason why they should do the job of spaces

white mulch
timid elk
#

that's literally their standard behaviour

white mulch
#

reminds me of gnu braindead style

timid elk
#

what's that

white mulch
#

they replace every 8 spaces with a tab

haughty abyss
timid elk
#

just use spaces

white mulch
#

or tabs

timid elk
#

spaces!!

flint idol
#

Spaces ftw

timid elk
#

what are you optimising for? source code size??

white mulch
#

I just like tabs more, I don't like being able to click in the middle of indent meme

timid elk
haughty abyss
#

this is very much not what i would expect

#

tbh

#

also that cant always render correctly

timid elk
#

you guys probably like elastic tabstops too

haughty abyss
#

there is no way to know what the user intended

white mulch
timid elk
#

time to fork mlibc to use spaces

haughty abyss
#

tbh i just like using a character intended for indendation to indent things

#

lol

timid elk
#

space is intended

haughty abyss
#

uh, no

#

a space is intended strictly for separating words

white mulch
#

average indentation war

timid elk
#

tab is for aligning to multiples of 8 which doesn't make sense in a programming context

#

then there's elastic tabstops...

haughty abyss
#

it never was

timid elk
#

it is!!

haughty abyss
#

ok

#

it once was

#

but its not for like

#

a looooong time

timid elk
#

not multiple of 8 indentation, ALIGNING to multiples of 8

haughty abyss
#

because of variable width fonts

timid elk
#

and every non-code editor will do that

haughty abyss
#

it doesnt align to multiples of 8

white mulch
#

any sane editor doesn't have align to 8 by default

haughty abyss
#

every non-code editor aligns to the next tabstop which is not necessarily 8 anythings

#

padding
12345
b

#

please tell me this is 8

#

lol

#

oh wait

#

its spaces

timid elk
#

e.g. 2 space + 1 tab makes 8 spaces

haughty abyss
#

ah

#

discord converts tabs to spaces

#

of course

haughty abyss
timid elk
#

discord based

timid elk
#

i mean visually

#

not actually 8 spaces

haughty abyss
#

here is google docs:

haughty abyss
haughty abyss
timid elk
haughty abyss
#

mobile skill issue

timid elk
#

BROWSER SAYS ITS TRUE

haughty abyss
#

no its a mobile skill issue

haughty abyss
#

and this is also the correct rendering

#

because a space is significantly smaller than most letters

timid elk
#

firefox

#

it's google docs fuckup not mobile fuckup

#

just try a bare html file

#

wait

#

html wouldn't indent that

haughty abyss
#

it would

timid elk
#

ok bare text file ig

haughty abyss
timid elk
#

nah

#

it's because mobile web google docs isn't full google docs

flint idol
haughty abyss
#

ah maybe okay

timid elk
#

it doesn't have the WYSIWYG editor

haughty abyss
#

ah

#

yeah

flint idol
haughty abyss
#

its a mobile skill issue

timid elk
#

it's a google docs skill issue

flint idol
#

It's a skill issue

timid elk
#

mobile browser does the standard browser thing

haughty abyss
#

i added an empty line just so that you can see that its doing things

haughty abyss
#

its a mobile gdocs skill issue

timid elk
#

yay

#

and in gdocs tab size is configurable

haughty abyss
#

that does in fact make sense

#

every good editor has that

#

lol

timid elk
#

and afaik it turns tab characters into paragraph starts or whatever

haughty abyss
#

no i dont think so

timid elk
#

that WYSIWYG indentation thing

haughty abyss
#

separate thing

flint idol
#

Thanks for hijacking my thread

timid elk
#

when it's at a newline it does that i think

#

rename the thread to indentation war

haughty abyss
#

google docs renders everything in a single big SVG holy shit

timid elk
#

obos2 will get a new thread

#

this thread stays indentation war

flint idol
haughty abyss
timid elk
#

do it

flint idol
#

Do it lol

haughty abyss
#

OBOS indentation war

#

okay then

timid elk
#

i habe caused the next incident

haughty abyss
#

this is not about obos now

flint idol
#

I will make new thread for obos2

timid elk
#

no don't do that actually

#

i like the thread

flint idol
#

Yeah ik

haughty abyss
#

yeah no just rename it back

#

it was just a joke lol

flint idol
#

Ye

timid elk
#

we can revert to the original name

flint idol
#

But when indentation war ends ai will

timid elk
#

was fun

white mulch
#

OBOS

timid elk
#

a whole minute

haughty abyss
#

qwinci you destroyed the fun

white mulch
flint idol
#

Qwinci mod abusing

haughty abyss
#

mod aboose

#

yeah

#

admins, ban this guy

flint idol
#

@ mintsuki

weak kestrel
#

@ meowntsuki

timid elk
#

@ everyone

flint idol
#

@ here

timid elk
#

fun fact when you ping someone discord adds them to the thread

flint idol
#

@ imsanana

white mulch
#

would everyone get added if you'd ping everyone

timid elk
#

i take advantage of that when I want to move a discussion to a more appropriate thread

#

i just ping everyone involved in the new thread

weak kestrel
timid elk
#

YES

white mulch
#

nah I don't want to get demodded

timid elk
#

ok

weak kestrel
#

counterpoint: it would be funny

timid elk
#

fair

haughty abyss
#

i tried

#

in a testing server ofc lol

#

hmm.

timid elk
#

does it ping everyone tho?

#

even when not added

#

or does it ping everyone in the thread

haughty abyss
#

maybe we should try now

torpid wigeon
#

real

#

i feel you

flint idol
#

currently compiling gcc

leaden carbon
flint idol
#

wha

timid elk
flint idol
#

Nay

#

When I made the changes to obos-strap

#

I needed to rebuild my packages

#

locally

timid elk
#

obbs when

#

obosstrap based build server

flint idol
#

Yes (no)

#

I have came to the decision to not rewrite OBOS, but still start a new osdev project

#

To see how the two compare now that I know more since I started this rewrite

leaden carbon
#

OBOS NT (obos new try)

flint idol
#

hmm limine or hyper trl

#

(the ultimate question)

#

((not really, most people here would pick limine))

#

okay I'll ping infy and mintsuki
I will use the bootloader of the first one to answer trl

#

(/j)

#

I'm gonna use C23 because it sounds cool

#

okay so my naming convention will probably just be snake case

#

I'll have a few "namespaces"

#

I guess

torpid wigeon
#

oberrow rust when

flint idol
#

never

torpid wigeon
#

woe

#

not even trying it?

flint idol
#
kernel_ - general kernel shit
sched_ - scheduler shit
ipl_ - ipl shit
arch_ - architecture shit
mm_ - memory manager shit
ignore this btw I'm not actually gonan use this, look down for reference
flint idol
torpid wigeon
#

woe is me

flint idol
#

woe be you

#

anyway I copied my old kernel's build system

torpid wigeon
#

meson

flint idol
#

because I couldn't be bothered to change that

torpid wigeon
#

what's the point of making something new if you'll just use everything from the old code base 🤔

flint idol
#

I won't

#

after taking GDT/IDT code

#

I am on my own

#

not even taking the allocator

#

okay time to setup limine

torpid wigeon
#

feel free to yoink from menix

real pecan
#

(jk idc what u use)

flint idol
#

every rewrite I make will alternate between using limine and hyper trl

#

the next one will use hyper

#

the one after will use limine

white mulch
#

why not support both

flint idol
#

I could do that

#

(one day)

real pecan
#

alternate between uacpi, qacpi, acpica and lai

flint idol
#

lol

real pecan
#

and for the last one roll your own

white mulch
#

I wonder which one would be the one that doesn't work on most amount of hardware

flint idol
#

LAI

real pecan
#

lai ofc

#

it doenst support half the opcodes

#

and the rest it supports incorrectly

flint idol
#

better idea?

#

(serious question tho)

torpid wigeon
#

what's ipl

lean glen
#

IPL and sched are both in the kernel

#

So

flint idol
lean glen
#

Just do the NT thing

#

ke_lower_ipl

flint idol
#

sounds good

main girder
flint idol
#

oops

#

that's what I meant

#

would something like the kernel's main init function be under ke

#
void ke_main()
{
    while(1)
        asm volatile ("" : : :"memory");
}```
#

most stable obos code:

torpid wigeon
#

legendary

flint idol
#

don't worry @ infy I will be implementing suspend support for this rewrite too

main girder
#

if it helps oberrow

#

it was like 5 rewrites for me before i even got to my first shitty unix clone that workedish

flint idol
flint idol
#

like some asm

torpid wigeon
#

i'm on my first rewrite atm

flint idol
#

I will throw gdt stuff into ki

#

that sounds correct enough

main girder
#

also how old r u oberrow

torpid wigeon
#

21

flint idol
main girder
#

just say ur age

#

nobody cares.

#

omg its oberrows age!!! now im gonna steal his identity muhaha!

#

nobodys thinking that.

flint idol
#

I am 2 years old

#

duh

main girder
torpid wigeon
#

i'm turning 22 in march

main girder
#

those 5 rewrites were done by the time i was like 18 ish

#

which feels like a lot more than 4 yrs ago

flint idol
#

ignore that

split rampart
#

okay, Ive reached the part with the explanation

#

but should it be a separate entity in the code structure

#

and why is everyone using obscure abbreviations from Windows

flint idol
#

cause NT is kinda cool as shit

split rampart
#

I have a question

flint idol
#

ye

split rampart
#

is that why so many people here are making NT like kernels

flint idol
#

yes

main girder
flint idol
#

ik

main girder
#

wrong reply

#

the chat shifted up

main girder
split rampart
#

irql

split rampart
main girder
#

like 3 yrs ago i started shilling it in here and i managed to do a good enough job (despite being rly annoying) to score a like cultural victory

#

ppl added NT to their set of things to look at to pilfer ideas from

#

which is good

flint idol
#

ah shit

#

GDT init... fail

split rampart
#

basically IRL

main girder
#

obos prob calls it ipl bc my project calls it ipl

#

i called it ipl because vms calls it ipl

flint idol
#

I used to call it irql

#

but I decided to switch because that's one less character to type (also keyronex uses it)

main girder
#

keyronex calls it ipl because mintia calls it ipl

split rampart
main girder
#

"what makes it page?" is an extremely in-depth look at the vmm

#

and is cool

#

theres the windows internals books youve probably already read

#

"windows nt file system internals" is a good one

split rampart
main girder
#

there are also lots of books about VMS and some sources floating around for that and those might give u some historical insight as well

#

theres a paper about the VMS virtual memory manager that the modern NT one still descends from

flint idol
#

ok GDT init is success

main girder
flint idol
#

hm where would I put kernel logging functions in

flint idol
split rampart
flint idol
#

I'm thinking rtl

#

rtl_printf

#

rtl_kernel_log

flint idol
split rampart
#

kprintf?

#

and that's it

#

I found it funny that after searching for some well-known issues and concepts I barely found any mentions of them on the server

split rampart
split rampart
#

First thing I checked was priority inversion and I didnt find much

#

almost like nobody really cares even though its important

devout niche
#

i used ipl because that's what it's always been called historically

uncut narwhal
#

is ipl the same as irql here?

#

or are they different

#

ive been assuming irql is a windows-ism for it lol

devout niche
#

in at least the motorola 68k and the vax-11 the "interrupt priority level" is the official term for that register

uncut narwhal
#

iirc the x86 manual calls it the TPR but sounds like its all the same thing with different names

split rampart
#

How do you even pronounce irql

uncut narwhal
#

just the letters

#

or at least thats how i do it

devout niche
#

and that's how they pronounce it

main girder
devout niche
# main girder evil

it is very interesting because i just checked and it seems i independently arrived at the approach of designating a particular level as the scheduling level and having rescheduling being effectively an interrupt at that level

split rampart
devout niche
#

a lot of american names do have that kind of style to them, where they sound almost foreign, but just a bit too goofy to be real

#

i might be wrong actually, i googled it and it might just be a fictional name

#

but that's how irql is pronounced by microsofters and this is notwithstanding that urkel appearsto only be a fictional name

uncut narwhal
#

yeah ive never heard that name before and im american (but also america is big)

#

checks out that microsofters would pronounce it that way though

main girder
#

You guys haven't heard of Steve Urkel?

devout niche
#

i can't find reference to a single other urkel (neither fictional nor real)

#

family matters
i've heard of it before, i think it's been alluded to by other american series more well known internationally

empty kernel
# main girder nobody cares.

he's never wanted to say how old he is, which is understandable considering his first and last name are all over his code. We only know that he is under 18

lean glen
#

Huh what

#

He said he was 17 a few times

flint idol
#

Nay

empty kernel
weak kestrel
timid elk
#

oberrow is 1.7.10

#

and i am 1.12.2

#

||minecraft versions||

frank flare
#

why obos rewrite

flint idol
#

Bored

#

I will work on both tho

lean glen
#

famous last words

flint idol
#

Planning on continuing some of the network stack maybe

#

Today

flint idol
frank flare
flint idol
#

IDT init... fail

#

IDT init success

#

I will now be getting some sort of logging working

#

after that I will be implementing IPL and a spinlock

short mortar
flint idol
#

you see I would

#

but that's too much work

short mortar
#

You can also do pmOS move and have different architectures use different boot protocols

flint idol
#

that is already what I do

short mortar
#

Also @ infy I'd probably switch to Hyper/Ultra entirely if it supported RISC-av

real pecan
#

i wont support risc-v until its a first class target with proper PE support

#

currently clang cannot produce risc-v PEs

short mortar
#

Didn't someone here say that there already are Windows builds for it?

real pecan
#

but ill probably pay a bit more attention to hyper in the coming weeks

#

because i want to improve some things

short mortar
real pecan
#

since windows doesnt even have all the risc-v related PE constants defined

#

for relocations etc

short mortar
#

Does anyone else besides OBOS, Ultra and me use it?

flint idol
#

some guy here used it

#

@cedar geyser I think used hyper

cedar geyser
#

Yes

#

Because its the only non-ass bootloader with a higher half protocol

#

For IA-32

frank flare
flint idol
#

interrupt priority level

frank flare
#

like the one in hardware (LAPIC/IOAPIC)?

flint idol
#

sure

#

it can be implemented as LAPIC.TPR (cr8)

frank flare
#

so that's what cr8 is for KEKW

flint idol
#

yup

#

it corresponds to bits 4:7 of LAPIC.TPR

frank flare
#

honestly I've skipped all of TPR, APR, PPR, IRR and all these things the SDM talked about cause I didn't think I needed them
and I didn't
but maybe one day they will prove useful in my kernel and I'll look them up in great detail

flint idol
#

interrupt priorities are quite useful

frank flare
#

for?

flint idol
#

masking out specific interrupts without stopping all of them

#

say you are in a place where you should have scheduler IRQs masked, but don't need all IRQs masked

#

raise IPL to the scheduler IPL, when you're done lower it

frank flare
#

sounds yummy tbh

#

pretty cool

flint idol
#

indeed

flint idol
#
void KeLogTrace(const char* verb, const char* format, ...);
void KeLogDebug(const char* verb, const char* format, ...);
void  KeLogInfo(const char* verb, const char* format, ...);
void  KeLogWarn(const char* verb, const char* format, ...);
void KeLogError(const char* verb, const char* format, ...);```
#

I am done implementing logging shenangians

frank flare
#

what is verb

flint idol
#

Ki
Ke
etc.

lean glen
#

how is that a verb

timid elk
flint idol
flint idol
#

I took a break

short mortar
timid elk
short mortar
#

(though I guess extending it to be actual interrupt priorities shouldn't be difficult I guess...)

frank flare
#

I had a breakdown trying to think of what Ki and Ke means

frank flare
timid elk
uncut narwhal
#

might be internal idk

#

i think windows has Mi vs Mm for internal vs normal memory manager

#

that might be init not internal tho

main girder
short mortar
#

It's so I can have drivers there

sweet compass
lean glen
#

Ki is like kernel internal

#

private functions

main girder
main girder
#

This is a terrible idea

short mortar
#

Why doesn't it?

lean glen
#

you can block interrupts without disabling them

short mortar
#

I don't disable them, but block all but timer

#

(I mean I could disable them as well)

main girder
#

If they can't interrupt you you may as well write a polling OS

#

Like DOS

#

This is shit and will be visibly shit like with human eyes in just interactive use

short mortar
#

I only block interrupts when I get one

#

Before the driver acknowledges it

#

What else am I supposed to do with level triggered interrupts?

main girder
short mortar
#

I mean another solution that someone here had (I don't remember who) in their microkernel was letting external driver code run in ring 0

short mortar
#

And my scheduler has priorities

#

Which drivers are supposed to use to preempt everything else

#

(I don't enforce them, but I could)

main girder
short mortar
#

Idk, wouldn't masking interrupts in IOAPIC all the time be slow?

short mortar
#

Except that I don't have a separate mechanism for interrupt notification delivery, it's all just IPC

#

So if I do a similar thing, what's bad about it?

main girder
#

You said you're blocking ALL INTERRUPTS (except timer) while in usermode

#

That's what you're doing right now

timid elk
#

yea but he said that's because he didn't implement more interrupt levels yet

#

so the only levels are dispatch, all-except-timers and timers and ipi probably

split rampart
#

If I got it right this is from Windows?

flint idol
split rampart
#

As far as I understand Ke is from Windows

flint idol
#

Yes

split rampart
#

And it's not just some generic kernel functions

#

it's a pretty specific thing in the Windows kernel

#

right?

flint idol
#

Idk I'm not the NT expert here

split rampart
#

weird but alright

split rampart
#

guess I'm about to become a Windows guru

flint idol
#

Why order books when you can filetype:pdf them trl

split rampart
flint idol
#

If you end up not liking it I'll take it

split rampart
#

Let's see, maybe I'll send it to you

split rampart
#

yes, why did you shove printing in there

#

answer now

split rampart
main girder
#

Ke is the inner layer and it contains like the scheduler and exception handling and whatever

#

the executive is literally everything else

#

its just a convention thing basically like Ke isnt allowed to allocate memory or call up into the executive (except when it does because thats the less ugly option than some alternative)

flint idol
#

I thought Rtl

split rampart
main girder
#

runtime library

#

which is like runtime stuff u can share between kernel and usermode

split rampart
#

Why are you so drawn to these weird abbreviations

#

Why copy all the silly stuff from Windows like these abbreviations

main girder
#

vibes

#

also it originally comes from like VMS

#

to be precise.

#

idk why other people are doing it i cant speak on them but for me i just like how it looks

#

and it plays into a specific thing my project is supposed to be

split rampart
main girder
#

maybe

split rampart
#

I wouldn't have thought for two days where to stick the print functions and would have just done kprintf and moved on

main girder
#

mine is in rtl but when i say that i mean its sharable between user and kernel mode so i dont have to copypaste it later.

split rampart
#

well, either you know your stuff and do it right from the start, or you dont sit still and after 100 iterations get the result you need

#

99.9% you don’t know, so you sit there and redo it

#

imo printing is definitely not worth the time, it’s easy to change

main girder
#

are u talking to me or to oberrow

upper tulip
#

I think they’re just ranting to the void

split rampart
main girder
#

nah

split rampart
#

or to the void

main girder
#

i made a project that worked with a full kernel and userspace and junk before i decided to rewrite in a new lang

#

and ik what to do, im not endlessly redoing anything

split rampart
#

Well, that's because you work alone and I'm sure you're deluded (you work alone?)

main girder
#

wdym deluded LOL

split rampart
#

imagine you’re given task X. Either you can do it right away if you know your stuff, but tbh that requires some serious experience. Otherwise, you'll be reworking it until your manager approves the solution, and it satisfies everyone involved

split rampart
#

But that's almost never the case in a project with people who do reviews and have more experience

#

In those conditions, youll either go through tons of iterations or get it right from the start

#

You think you'll get it right from the start and be confident about it?

#

That's one of the reasons why working solo on your own projects can't make you a good engineer

main girder
#

interesting

split rampart
#

you think it's nonsense?

#

Just I have negative experience related to the load on a personal project vs a project during an internship in a non-personal project

main girder
#

you can definitely set yourself difficult goals you dont know how to do and then learn how to do them and not be satisfied until its sufficiently flexible/fast/whatever

split rampart
#

Well, maybe you know how to optimize your work process

#

I had to simply rethink the order in which things should be done and where to allocate resources lol

#

because you have 6 big tasks hanging over you, and you need to get them all done, whereas before you were only handling one of these six, and over a longer period of time

#

and then your manager comes and says it's all wrong because of security risks, and this part won't work well in conditions you didn't even consider

#

That's why I don't get how you manage to get everything right on the first try?

#

how do you do things, will?

#

and how do you spend two days just looking for a name for a print function

main girder
#

i dont get everything right on the first try wdym

#

and that wasnt me that was oberrow

#

lol

main girder
#

youre right that you cant completely simulate a working environment with personal projects but i dont think anybody has said you can

split rampart
#

you both are doing nt likes

main girder
#

i wouldnt even call mine an "nt like" really, the only things from nt at this point are the vague structure, the naming scheme, and like, asynchronous IO

split rampart
#

I thought that in my view of things, you placed yourselves in the category of those who know their stuff and get everything right on the first try, just as soon as you said "and ik what to do, im not endlessly redoing anything"

main girder
#

i meant in the sense of like

#

ive written a full kernel before and i basically know how to structure the one im working on now as a result

#

but its different and somewhat more ambitious and im doing things i havent done before so i have to iterate upon components obviously

main girder
#

i think you can absolutely practice engineering skills with a project like this if u have the discipline to not go like "fuck it" and remove something from ur list of requirements as soon as it gives u some trouble

#

it doesnt model pressure from a boss or hard deadlines but thats difficult to model outside of just like, working

main girder
split rampart
#

To learn, you probably need to do some kind of internship or something like that, and after that work on your own projects

main girder
#

u havent been here but personally ive been planning and researching for yrs

split rampart
main girder
#

and i was at least stress testing my last kernel, im doing unit tests this time (since u guilted me into it)

lunar narwhal
#

do you have a kernel project

#

you should create a thread here on the server

#

i think everyone can create their own thread in progress report

split rampart
#

so I have to sit and mumble in Omar's room

#

sorry, Omar

lunar narwhal
flint idol
#

okay I will be continuing the network stack today

frank flare
#

obos is back

timid elk
#

OBOS1?

flint idol
#

yes

flint idol
vale nymph
#

0805

split rampart
frigid tide
#

wtf

flint idol
#

your point?

frigid tide
# flint idol your point?

That’s just like a huge and impressive undertaking if you pull it off which I’m sure you will because OBOS is already really cool

#

One of my fav projects on here

#

And our goat Nyaux

flint idol
#

I do have basically working UDP atm

#

I am just missing TCP and DHCP (which will be in userspace)

#

ngl why do Linux users use TCP, it has windows in it

frigid tide
#

What protocols are managed by the kernel usually and which ones are managed in user space?

flint idol
#

DHCP is userspace on linux

#

From what I know stuff like ethernet II, IP(v6), ARP, UDP, and TCP are done in the kernel

frigid tide
#

Interesting

#

How can I not use it

flint idol
#

uhh

#

you can just use the internet

#

*just not use

frigid tide
#

Oh 😭

#

Well we’re too far in now aren’t we

flint idol
#

many protocols use TCP

#

including HTTP(S)

#

FTP

#

SSH

#

a bunch of other shit too

#

Minecraft Java edition servers use it

lean glen
#

everything is tcp

#

pretty much

haughty abyss
#

not really no

#

30% of worldwide web traffic is UDP

lean glen
#

70% is TCP

#

so

frigid tide
flint idol
#

I want to make a DHCP client for obos ngl

#

before I get TCP

frigid tide
#

DHCP is cool and based and TCP is cringe

#

Do it

lean glen
flint idol
#

yeah they have completely different purposes

#

one is for transmission control

#

the other is for dynamic host configuration

frigid tide
#

I know 😭 it’s just people made jokes about how tcp is bad earlier

flint idol
#

I never said TCP was had

#

I was making a joke on how the protocol has something called a "window"

#

so like why would Linux users use it if it has windows

frigid tide
#

Oh😭😭 I didn’t pick that up

#

Mb

flint idol
#

np

#

anyway I am upgrading my packages

#

after a week or two

#

I have ~500 packages

frigid tide
#

Damn 😭

#

What pkg manager do you use

flint idol
#

apt

#

I use debian

#

ok it was more like 422 packages

#

but whatever

weary hound
#

debane

frigid tide
#

Ahhhh I was gonna say you could probably set up automatic package updates

flint idol
#

nah my computer was in suspend the entire time

frigid tide
#

Makes sense

flint idol
#

also nothing is stopping me from doing it myself

#

with some sort of dumb service

frigid tide
#

I just keep mine on basically all the time

weary hound
#

configure it to wake up and do updates and then go back to sleep

frigid tide
#

I use arch with cinnamon so idk how I could do automatic updates in the gui but it’s probably simple in bash

flint idol
#

debian actually seems to already do it on a timer

#

by default

#

before I do anything yet I want to add a "broadcast ip" field to the ip table structure in obos

#
typedef struct ip_table_entry {
    ip_addr address;
+   ip_addr broadcast_address;
    uint8_t subnet_mask;
    udp_queue_tree received_udp_packets;
    rw_lock received_udp_packets_tree_lock;
    LIST_NODE(ip_table, struct ip_table_entry) node;
} ip_table_entry;```
flint idol
#

ok I did that

#

and also for some unrelated reason also made my HPET, SMP, and IOAPIC code all stop using my ACPI table parsing

#

and switch to uacpi early table access

#

I will make my DHCP thing in linux userspace first

#

and port it to obos when I get sockets

#

ngl doing it in userspace is gonna be BORING

#

and nothing is stopping me from doing it in kernel-space

#

(I don't want to recopy my internet structs)

#

anyway I copied my internet structs over

flint idol
#

oh wow the DHCP spec is bum

#

you have two separate specs, one for the options of the DHCP header, and one for the DHCP header itself

flint idol
thick jolt
#

hey omar

#

good luck on obos

#

im happy to see a ton of progress going on

flint idol
#

thanks

flint idol
#

DHCP is such an annoying protocol

white mulch
#

why

#

its pretty simple

flint idol
#

I am just not a fan of it

#

just a skill issue on my end

#

I need to decode the DHCP options now

#

in received packets

#

should be "fun"

#

anyway my DHCP client will simply take the first DHCPOFFER and use that

#

idk if I'm supposed to tell everyone else that I rejected their offer

#

I'll check that quickly

white mulch
# flint idol should be "fun"

at least it has a nice format where you can skip ones you don't care about lol (as there is the length field after the tag before any data)

flint idol
#

fair

#

wait wha

#

what is the difference between DHCPOFFER and DHCPACK

white mulch
#

ack is what the server sends after you accept an offer (using the request packet)

flint idol
#

ah

white mulch
#

I guess in theory it could also nak your request in some cases

#

like if you request an ip already in use or smth

flint idol
#

when I request options using the PARAMETER_REQUEST option, do I do that in DHCPDISCOVER or DHCPREQUEST

#

I mean probably DHCPDISCOVER

white mulch
#

yeah

flint idol
#

thanks

white mulch
#

in request you only need the requested ip you want to accept + the dhcp server

flint idol
#

I see

white mulch
#

and the siaddr from the offer packet ig but that's part of the header not options

flint idol
#

DHCP clarifies the interpretation of the 'siaddr' field as the
address of the server to use in the next step of the client's
bootstrap process. A DHCP server may return its own address in the
'siaddr' field, if the server is prepared to supply the next
bootstrap service (e.g., delivery of an operating system executable
image). A DHCP server always returns its own address in the 'server
identifier' option.

white mulch
#

or well idk if that's really required but I do that

#

mabe its not

#

because the same address is also put to the dhcp server option

flint idol
#

DHCPREQUEST seems to want siaddr set to zero

#

although I will have to say that the DHCP spec putting the message type in an option is annoying

#

I do suppose that the header format is from a different protocol

white mulch
flint idol
#

yeah

#

okay I just added a dhcp_foreach_option helper

#

and implemented part of my dhcp_discover function

#

aka the thing that looks for an offer

#

none of this is tested atm

#

but anyway

#

now it can:

  • format and broadcast a DHCPDISCOVER message, which also requests the routing info, subnet mask, a broadcast address, and whether the server says to enable IPv4 forwarding or not
  • scan for offers and choose one
#

next thing I need is to implement is accepting the offer

#

after finishing my dhcp_discover function

#

I want to implement dhcp_release and dhcp_inform functions

flint idol
#

I might just ignore all offers where siaddr is not the same IP that is in the ipv4 header

#

for simplicity (I don't want to implement ARP again)

short mortar
flint idol
#

exactly

#

ig the main thing annoying me was the fact I had to use raw sockets

flint idol
#

so in theory I have DHCP discovery implemented

#

it's just nothing is tested at all

flint idol
#

ok I am about to run the dhcp client and test dhcp_discover (this is NOT going to go well)

#

running ./obos_dhcpd wlp2s0

#

inb4 entire network crashes

flint idol
#

SIOCGIFHWADDR
most normal IOCTL constant

uncut narwhal
#

ok what does that constants name actually stand for i gotta know

flint idol
#

Get IF (internet) HardWare Address

uncut narwhal
#

wild

weary hound
#

i thought the IF stood for interface?

flint idol
#

interface

#

whatever

uncut narwhal
#

also yeah that

flint idol
#

probably that anyway

#

I am currently fighting with pcap

uncut narwhal
#

also in that case what's sioc supposed to mean lol

flint idol
#

so it gives me my packet as soon as they arrive

#

it seems like I need pcap_set_immediate_mode

uncut narwhal
#

(also good luck)

flint idol
#

ok I got it to work

#

(not the DHCP client, libpcap)

flint idol
#

oops

#

accidentally fucked my DHCP

#

wait what

#

ok "fixed" it

flint idol
#

and all of those values are indeed correct

#

anyway

#

I will push this code soon

#

I need a better name for this

#

obos_dhcpd isn't pretty

#

odhcpd already exists

#

now, my DHCP client for obos doesn't actually currently work on obos

#

how I designed it makes it basically fully cross platform as long as you define like 3 functions

deep ember
#

dhcpd makes it sound like it's a dhcp server

flint idol
#

good point

#

dhcpclient

#

no that's too long of a name

deep ember
#

dhcpcd is called dhcpcd for a reason :^)

flint idol
#

okay new name is obos_dhcpcd

#

or actually

#

obos_dhcpc

#

since it isn't a daemon

vale nymph
#

its a demon 👿

flint idol
#

and then it also needs you to define these functions

extern void frame_initialize(frame* f, const void* data, size_t sz);
// Decrements refs, and if it is zero, free data.
extern void frame_unref(frame* f);
extern frame* frame_alloc();
uint32_t dhcp_generate_xid();
__attribute__((format(printf, 1, 2))) int dhcp_log(const char* format, ...);```
flint idol
vale nymph
flint idol
#

cool

#

or maybe not cool

#

I'm too tired to think

vale nymph
#

it does its job nicel

#

y

#

(not tested against a real router)

flint idol
#

lol

#

mine is tested against a real router on a wifi with many devices on it

#

I wonder how long astral would hold in a "real" network

#

obos starts to melt after ~5 minutes of receiving packets

#

until it dies out

flint idol
#

average DHCP client-server transmission

#

best DHCP client

#

I wrote some dumb program

#

that writes out raw bytes onto the network

#

I should use it on /dev/urandom

#

what could possibly go wrong

#

now I go slep

#

ah shit

#

okay network is back

flint idol
#

anyway

#

time to start

#

writing TCP code

#

rfc793 is a lot simpler than newer specs

#

To govern the flow of data between TCPs, a flow control mechanism is
employed. The receiving TCP reports a "window" to the sending TCP.
This window specifies the number of octets, starting with the
acknowledgment number, that the receiving TCP is currently prepared to
receive.

#

interesting

white mulch
#

btw if you want to make lazy irql even faster in vm's you can have a flag that gets set by the irq handler in case it alters cr8, check that inside the irql lower function and only if its set alter cr8 (though it also requires you to disable interrupts for the duration when you do the check + possible cr8 modification)

flint idol
#

I want to make a big change to OBOS
And that is changing the allocator interface

#

currently it's doodoo because it uses function pointers, which makes it so nothing can be inlined, and also compiler warnings related to use after frees and stuff like that won't work

flint idol
#

I just fixed a bug with the r8169 driver

#

where it was basically always one packet behind for some dumb reason

#

while receiving stuff

flint idol
frank flare
flint idol
#

lol

vale nymph
#

was it message of the day or quote of the day

#

I forgot

#

but yeah

flint idol
#

The Quote of the Day (QOTD) service is a member of the Internet protocol suite, defined in 1983 in RFC 865 by Jon Postel. As indicated there, the QOTD concept predated the specification, when QOTD was used by mainframe sysadmins to broadcast a daily quote on request by a user. It was then formally codified both for prior purposes as well as for ...

#

QOTD it seems

vale nymph
#

I remember there being a public one

flint idol
#

anyway I already have tested it over my home network

vale nymph
#

send an udp packet and it'll reply with qotd

flint idol
#

got nothing

vale nymph
#

hmm

flint idol
#

wait it's tcp

#

and not udp

vale nymph
#

no it also works over udp

#

tho idk if the guy is exposing it over udp anymore

flint idol
vale nymph
#

I remember there was an udp one

#

blegh

#

I had done it with just udp

flint idol
#

I will just do nmap 0.0.0.0/0 -p17

flint idol
#
while : ; do sudo nc -ulkp 17 -e /usr/games/fortune; done```
#

QOTD server

#

on UDP

#

or

while : ; do sudo nc -ulkp 17 -c 'cat /etc/motd'; done
#

to echo /etc/motd

vale nymph
#

let me ssh as root into your computer pweading

flint idol
#

fine

#

my ip is 127.0.0.1

#

root password is password123

flint idol
#

woaw why does obos spend so much time in IO instructions

#

oh wait

#

port e9

#

output

#

but my question is why an I rdmsring so much

#

seemingly

#

oh

flint idol
#
        frame->buf = map_registers(Mm_AllocatePhysicalPages(((TX_PACKET_SIZE*128) + (OBOS_PAGE_SIZE-((TX_PACKET_SIZE*128)%OBOS_PAGE_SIZE))) / OBOS_PAGE_SIZE, 1, nullptr), ((TX_PACKET_SIZE*128) + (OBOS_PAGE_SIZE-((TX_PACKET_SIZE*128)%OBOS_PAGE_SIZE))), false, true);```
just found this line of code in obos lol
#

in case you are wondering what it does, I think it allocates contiguous space for a buffer then maps it

weak kestrel
#

code from obos
I think ...

flint idol
#

yeah I kind of can't decode my own code that I wrote barely a month ago

cedar geyser
flint idol
#

anyway I shall continue

#

work on TCP

#

I think implementing reception first will be easier

#

because then when I start doing transmission I can have a way of checking for ACKs from the other side

#

I will give 0.00$ to whoever implements a virtio net driver for obos

white mulch
#

imo virtio in general is weird, like its somehow more complex than real hardware which is why I never really got around to making drivers for it

#

though it might also be caused by the fact that the virtio spec sucks lol

flint idol
#

I have heard it is easier

#

than some real devices

#

and I will also give 0.00$ to whoever implements a e1000 driver for obos

#

testing on real hardware exclusively kind of really sucks

white mulch
#

did you implement rtl8139 yet

flint idol
#

no

#

I have heard it is like the r8169 but simpler

white mulch
#

you can basically use the same driver for it

#

with a few if's

flint idol
#

I will look into that soon

#

because debugging on real hw sucks!

#

I am thinking to implement gdbstub over UDP in obos

#

I already have the gdb stub

#

I just need to put in the necessary "glue" code

timid elk
#

sounds cool

#

gdbstub over ARP

flint idol
timid elk
#

because OBOS is ARP OS

flint idol
real pecan
#

Implement a new TCP like protocol for obos

timid elk
#

gdb stub over quic

#

gdbstub over carrier pidgeons

#

pigeons

#

pidgins

#

hpw is it spelled

flint idol
#

pigeons

timid elk
#

yea

flint idol
#

because I found a bug with UDP that only happens in some cases

flint idol
#

but anyway I will give the details of the bug

#

in a bit

flint idol
#
Page fault at 0xffff9000002af1ef in kernel-mode while to read page at 0x6475, which is unpresent. Error code: 0
#
bool com_check_irq_callback(struct irq* i, void* userdata)
{
    OBOS_UNUSED(i);
    serial_port* port = (serial_port*)userdata;
    return inb(port->port_base + LINE_STATUS) != 0 && !port->isFaulty;
}```
#

the fault is on port->port_base

#

wtf

#

this gdbstub is cursed