#OBOS (not vibecoded)
1 messages · Page 37 of 1
Cool
productive aka practicing guitar 
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
do the mica naming convention
do astral naming convention
facility$verb_noun
the NT naming convention is pretty nice
the dollar signs mean its cool
Funny how dollar signs are legal iirc in C identifiers
yes
they are
that's mine but using namespaces 
serenityos and some other os uses sys$name for syscalls
this surprises ppl but its because of DEC who used $ everywhere and it was to avoid precluding using C on their OSes
for serenity's case its a weird larp
yep
i have no idea why they randomly use $ for that
they don't need it
Also maybe I will use a different language...
yeah lol
as a GNU extension
its nonstandard
lol which
if u do c++ u can use qacpi 
Yeah no I'll just use C in that case

My naming convention might copy snake_case or be the NtNamingConvention
If I do rewrite of course
whatever u do dont do tabs 
why? tabs are great
Like the indentation thing?
lmfao this discussion again
oh thats great for shkwve v2 now with more C++!
yes
Yeah
tabs are objectively better because you can set it to what you want them to be as a user
I am going to use spaces
Who is the user of obos?
me 🙂
I'll see what I will do
Also maybe this is all bait to get the obos thread alive because I am lonely 
like C but your program gets optimized away
are you rewriting it in C++?
All options go back to C
zig sucks, I'd honestly just pick C
use my libraries 
how
yeah zig sucks
I think I have tried zig like once, I don't exactly remember why I didn't use it more
so is it a bootloader or a firmware thing
because
if its a firmware thing
probably maybe both idk yet
Gtg now
I could contribute
would love contributors
so it boots my OS
for DT? yeah maybe
ah
friggg
#1311843641005703298 tho
yk the rusty thing
you can do the same for spaces
if you can't, your editor sucks
huh no you can't?
space width is not a display option
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
💀
that's literally their standard behaviour
reminds me of gnu braindead style
what's that
they replace every 8 spaces with a tab
holy shit what the fuck
ok that's braindead
just use spaces
or tabs
spaces!!
Spaces ftw
what are you optimising for? source code size??
I just like tabs more, I don't like being able to click in the middle of indent 
why is that a wtf
you.can.congifure.taht
this is very much not what i would expect
tbh
also that cant always render correctly
you guys probably like elastic tabstops too
there is no way to know what the user intended
maybe but eh, idrc use whatever you want, I will keep using tabs
time to fork mlibc to use spaces
space is intended
average indentation war
tab is for aligning to multiples of 8 which doesn't make sense in a programming context
then there's elastic tabstops...
its not for multiples of 8?
it never was
it is!!
not multiple of 8 indentation, ALIGNING to multiples of 8
because of variable width fonts
yes.
and every non-code editor will do that
it doesnt align to multiples of 8
any sane editor doesn't have align to 8 by default
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
e.g. 2 space + 1 tab makes 8 spaces
uh no
discord based
here is google docs:
notepad defaults to a fixed width font
mobile skill issue
BROWSER SAYS ITS TRUE
no its a mobile skill issue
^^ renders like this in both chrome and firefox for me
and this is also the correct rendering
because a space is significantly smaller than most letters
firefox
it's google docs fuckup not mobile fuckup
just try a bare html file
wait
html wouldn't indent that
it would
ok bare text file ig
actually its probably because your screen is super tiny
ah maybe okay
it doesn't have the WYSIWYG editor
Rendered on chrome on mobile
its a mobile skill issue
it's a google docs skill issue
It's a skill issue
mobile browser does the standard browser thing
i added an empty line just so that you can see that its doing things
yeah fair
its a mobile gdocs skill issue
and afaik it turns tab characters into paragraph starts or whatever
no i dont think so
that WYSIWYG indentation thing
separate thing
Thanks for hijacking my thread
google docs renders everything in a single big SVG holy shit

do it
Do it lol
i habe caused the next incident
this is not about obos now
I will make new thread for obos2
Yeah ik
Ye
we can revert to the original name
But when indentation war ends ai will
was fun
OBOS
a whole minute
qwinci you destroyed the fun

Qwinci mod abusing
@ mintsuki
@ meowntsuki
@ everyone
@ here
fun fact when you ping someone discord adds them to the thread
@ imsanana
would everyone get added if you'd ping everyone
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
try it
YES
nah I don't want to get demodded
ok
counterpoint: it would be funny
fair
no
i tried
in a testing server ofc lol
hmm.
does it ping everyone tho?
even when not added
or does it ping everyone in the thread
currently compiling gcc
dont you dare
wha
for powerpc this time?
Nay
When I made the changes to obos-strap
I needed to rebuild my packages
locally
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
hmm limine or hyper 
(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 
(/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
is this even a question
oberrow rust when
never
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
nay
woe is me
meson
because I couldn't be bothered to change that
what's the point of making something new if you'll just use everything from the old code base 🤔
I won't
after taking GDT/IDT code
I am on my own
not even taking the allocator
okay time to setup limine
feel free to yoink from menix
every rewrite I make will alternate between using limine and hyper 
the next one will use hyper
the one after will use limine
why not support both
alternate between uacpi, qacpi, acpica and lai
lol
and for the last one roll your own
I wonder which one would be the one that doesn't work on most amount of hardware
LAI
This is kinda dumb
what's ipl
interrupt permission level
sounds good
interrupt PRIORITY level.
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:
don't worry @ infy I will be implementing suspend support for this rewrite too
if it helps oberrow
it was like 5 rewrites for me before i even got to my first shitty unix clone that workedish
and some more boilerplate code
this gives me a lot of hope
like some asm
i'm on my first rewrite atm
helper functions
I will throw gdt stuff into ki
that sounds correct enough
21
I am existing
just say ur age
nobody cares.
omg its oberrows age!!! now im gonna steal his identity muhaha!
nobodys thinking that.
this may unhelp: i just turned 22
i'm turning 22 in march
those 5 rewrites were done by the time i was like 18 ish
which feels like a lot more than 4 yrs ago
ipl shit?
ignore that
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
cause NT is kinda cool as shit
I have a question
ye
is that why so many people here are making NT like kernels
yes
windows actually calls it irql
ik
i meant to reply to this
irql
my fault
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
ah chill, I just remembered I can google it : its Interrupt ReQuest Level
basically IRL
obos prob calls it ipl bc my project calls it ipl
i called it ipl because vms calls it ipl
I used to call it irql
but I decided to switch because that's one less character to type (also keyronex uses it)
keyronex calls it ipl because mintia calls it ipl
sooo what would you suggest diving deeper into in nt that could be useful for example for me
"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
and so that I don't end up stumbling upon code leaks from 100 years ago
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
ok GDT init is success
werent you porting to a new architecture
hm where would I put kernel logging functions in
I am doing both that and a rewrite at the same time
big
something like a printf function
I'm thinking rtl
rtl_printf
rtl_kernel_log
well not this because that's evil
Non-standard problems
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
Which is cool and kinda funny too, you can dig up some interesting info about nt and os history
whatd you search up
First thing I checked was priority inversion and I didnt find much
almost like nobody really cares even though its important
in this case not quite
i used ipl because that's what it's always been called historically
is ipl the same as irql here?
or are they different
ive been assuming irql is a windows-ism for it lol
in at least the motorola 68k and the vax-11 the "interrupt priority level" is the official term for that register
iirc the x86 manual calls it the TPR but sounds like its all the same thing with different names
How do you even pronounce irql
eye arr que ell
just the letters
or at least thats how i do it
in america, there is apparently a popular name "Urkel"
and that's how they pronounce it
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
U-r-kidding me with that name
no, it's a real name that americans use
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
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
You guys haven't heard of Steve Urkel?
that's the only one i've found on google
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
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
Nay
no, you might be getting confused with someone else
1.7?
why obos rewrite
famous last words
lol
I wish I had so much time lol
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
Just support both at the same time
You can also do pmOS move and have different architectures use different boot protocols
that is already what I do
Also @ infy I'd probably switch to Hyper/Ultra entirely if it supported RISC-av
i wont support risc-v until its a first class target with proper PE support
currently clang cannot produce risc-v PEs
Didn't someone here say that there already are Windows builds for it?
but ill probably pay a bit more attention to hyper in the coming weeks
because i want to improve some things

thats definitely not true
since windows doesnt even have all the risc-v related PE constants defined
for relocations etc
Does anyone else besides OBOS, Ultra and me use it?
Yes
Because its the only non-ass bootloader with a higher half protocol
For IA-32
what is IPL used for
interrupt priority level
like the one in hardware (LAPIC/IOAPIC)?
so that's what cr8 is for 
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
interrupt priorities are quite useful
for?
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
indeed
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
what is verb
Ki
Ke
etc.
how is that a verb
how do you even get bored making a network stack :clueless:
It isn't
Because I wasn't
I took a break
I use it to disable interrupts while in userspace, but not kill timers and IPIs
very cool stuff i want to do the same
(though I guess extending it to be actual interrupt priorities shouldn't be difficult I guess...)
your scopes are beyond our understanding
I had a breakdown trying to think of what Ki and Ke means
nice, I have don't have userspace yet but I will keep it in mind
Ki is KiCad mode
might be internal idk
i think windows has Mi vs Mm for internal vs normal memory manager
that might be init not internal tho
Why do you disable interrupts in userspace
Why shouldn't I?

It's so I can have drivers there
because microkernel
Ke is kernel
Ki is like kernel internal
private functions
This makes no sense
This makes no sense
This is a terrible idea
Why doesn't it?
you can block interrupts without disabling them
I don't disable them, but block all but timer
(I mean I could disable them as well)
Interrupts interrupt you because they need good response time
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
how does blocking interrupts affect it?
I only block interrupts when I get one
Before the driver acknowledges it
What else am I supposed to do with level triggered interrupts?
So they're all enabled until you get one and then you mask that one off until the driver thread is scheduled in?
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
I haven't figured out how to do the masking
And my scheduler has priorities
Which drivers are supposed to use to preempt everything else
(I don't enforce them, but I could)
Have you looked at interrupt handling in QNX
Idk, wouldn't masking interrupts in IOAPIC all the time be slow?
No
Apparently what I do/my API is very similar to https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.getting_started/topic/s1_inter_Handling.html
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?
You said you're blocking ALL INTERRUPTS (except timer) while in usermode
That's what you're doing right now
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
tbh I don't see how it's better than kprintf
If I got it right this is from Windows?
No I just wrote that code
As far as I understand Ke is from Windows
Yes
And it's not just some generic kernel functions
it's a pretty specific thing in the Windows kernel
right?
Idk I'm not the NT expert here
weird but alright
Ordered a book on windows memory management yesterday
guess I'm about to become a Windows guru
Why order books when you can filetype:pdf them 
Bad habit of throwing money around left and right
If you end up not liking it I'll take it
Let's see, maybe I'll send it to you
why would that go in Ke
I've got an old and well worn copy of Windows(r) Internals lying around somewhere. I read it a while back and have already forgotten a lot of things
ya generally speaking theres like two layers, the kernel (Ke) and the executive (everything else)
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)
sounds reasonable
rtl?
Why are you so drawn to these weird abbreviations
Why copy all the silly stuff from Windows like these abbreviations
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
well, it seems like oberrow doesn't even know about it and just copies
maybe
I wouldn't have thought for two days where to stick the print functions and would have just done kprintf and moved on
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.
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
are u talking to me or to oberrow
I think they’re just ranting to the void
probably both
nah
or to the void
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
Well, that's because you work alone and I'm sure you're deluded (you work alone?)
wdym deluded LOL
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
It's about knowing what to do and doing it right the first time
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
interesting
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
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
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
i dont get everything right on the first try wdym
and that wasnt me that was oberrow
lol
i think you can ground yourself with realistic conditions u didnt think of by just looking at related existing work that works in like production use cases and stuff
youre right that you cant completely simulate a working environment with personal projects but i dont think anybody has said you can
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
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"
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
what category are you in
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
and that took me yrs to do the first time
Maybe, if you know how to do everything – plan, design, stick to the plan, have the patience to test, and know how to do it
To learn, you probably need to do some kind of internship or something like that, and after that work on your own projects
u havent been here but personally ive been planning and researching for yrs
the “men in black” category
and i was at least stress testing my last kernel, im doing unit tests this time (since u guilted me into it)
👀
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
worse, I came back to work and immediately remembered all the downsides of being employed
so I have to sit and mumble in Omar's room
sorry, Omar
iirc mintia 2 even has a development plan btw
okay I will be continuing the network stack today
obos is back
OBOS1?
yes
funny how that's what the o in oberrow stands for
0805
no way
Bro just is casually making a full network stack
wtf
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
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
What protocols are managed by the kernel usually and which ones are managed in user space?
DHCP is userspace on linux
From what I know stuff like ethernet II, IP(v6), ARP, UDP, and TCP are done in the kernel
Really?
Interesting
How can I not use it
many protocols use TCP
including HTTP(S)
FTP
SSH
a bunch of other shit too
Minecraft Java edition servers use it
Os dev with nothing but the intel manual and Ken and Ritchie’s The C programming language 
these do not accomplish the same thing
yeah they have completely different purposes
one is for transmission control
the other is for dynamic host configuration
I know 😭 it’s just people made jokes about how tcp is bad earlier
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
debane
Ahhhh I was gonna say you could probably set up automatic package updates
nah my computer was in suspend the entire time
Makes sense
I just keep mine on basically all the time
configure it to wake up and do updates and then go back to sleep
I use arch with cinnamon so idk how I could do automatic updates in the gui but it’s probably simple in bash
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;```
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
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
thanks
DHCP is such an annoying protocol
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
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)
ack is what the server sends after you accept an offer (using the request packet)
ah
I guess in theory it could also nak your request in some cases
like if you request an ip already in use or smth
when I request options using the PARAMETER_REQUEST option, do I do that in DHCPDISCOVER or DHCPREQUEST
I mean probably DHCPDISCOVER
yeah
thanks
in request you only need the requested ip you want to accept + the dhcp server
I see
and the siaddr from the offer packet ig but that's part of the header not options
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.
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
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
ah good to know, I guess the example in the wikipedia page is wrong in that regard (though ig its just ignored by most servers even if you happen to set it)
BOOTP
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
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)
It's just 4 broadcast packets
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
SIOCGIFHWADDR
most normal IOCTL constant
ok what does that constants name actually stand for i gotta know
Get IF (internet) HardWare Address
wild
i thought the IF stood for interface?
also yeah that
also in that case what's sioc supposed to mean lol
so it gives me my packet as soon as they arrive
it seems like I need pcap_set_immediate_mode
(also good luck)
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
dhcpd makes it sound like it's a dhcp server
dhcpcd is called dhcpcd for a reason :^)
its a demon 👿
you basically just define a function to transmit data on your interface of choice, set interface->mac_address (interface is some struct passed around represting an NIC or smth) to the MAC address of your interface, and have something calling interface->data_ready whenever there is data ready
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, ...);```
does astral have it's own DHCP client or did you port one or smth
I wrote my own crappy dhcp client
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
maybe one day I will write a basic r8169 driver for astral
average DHCP client-server transmission
lol
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
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
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)
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
I just fixed a bug with the r8169 driver
where it was basically always one packet behind for some dumb reason
while receiving stuff
https://github.com/OBOS-dev/obos-dhcpc/
btw I just pushed my dhcp client
A DHCP client that will soon run on OBOS. Contribute to OBOS-dev/obos-dhcpc development by creating an account on GitHub.

os goals
lol
if you want to test it over the internet, you can try to talk to a MOTD server
was it message of the day or quote of the day
I forgot
but yeah
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
I remember there being a public one
anyway I already have tested it over my home network
I think djxmmx.net is the one that still works
send an udp packet and it'll reply with qotd
got nothing
hmm
as in, the site is only serving it on TCP
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
let me ssh as root into your computer 
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
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
code from obos
I think ...
yeah I kind of can't decode my own code that I wrote barely a month ago
Well look at it
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
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
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
did you implement rtl8139 yet
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
I do suppose that I will need to make some changes, I broke that code back in August or September
because OBOS is ARP OS
lol
Implement a new TCP like protocol for obos
gdb stub over quic
gdbstub over carrier pidgeons
pigeons
pidgins
hpw is it spelled
pigeons
yea
actually I want to do that now
because I found a bug with UDP that only happens in some cases
this bug doesn't affect UDP in 'server' mode
but anyway I will give the details of the bug
in a bit
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
