#OBOS (not vibecoded)

1 messages · Page 44 of 1

dense vigil
#

I know how it works :p

#

You can have a program interpret the noises

#

So when you play a diffrent note it does a different action

sterile sparrow
#

bruh

#

my shit's worse dw

real pecan
#

oberrow is the younger version of dwl

flint idol
#

dreaming warlord or smth

real pecan
#

lol yeah but hes back

flint idol
#

ah

torpid wigeon
dense vigil
#

What’s the cherno

real pecan
#

C++/game YouTuber

dense vigil
#

Ohhhhhh

#

I vaguely remember now

#

I think I watched his tutorials at one point?

real pecan
#

Probably

dense vigil
#

I’ve long left tutorial hell though thankfully

torpid wigeon
#

i don't like his videos

#

he yaps for 40 minutes about a topic that you learn within 10 days of writing C++ and is just a common skill issue

dense vigil
#

yeah i remember him being ass lol

stark sigil
#

somewhat (un)related but i wonder how people dont understand variables in programming languages

#

its like math variables

torpid wigeon
#

what

stark sigil
#

sure, fine with the uint's and ints and other types

#

but the variables themselves idk

torpid wigeon
#

ive never met such a person

real pecan
lean glen
torpid wigeon
#

me when const variables in math

lean glen
#

also x = x + 1 would probably give a heart attack to a mathematician

stark sigil
#

just dont change x trl

barren merlin
#

They would say the set of solutions is the empty set

tall sluice
#

J feel like he used a lot of time explaining things that could be explained in half the time

uncut narwhal
#

@flint idol btw how does obos handle handles? like managing them, sharing if thats a thing you do, associating the number with an object, etc

flint idol
#

ill explain after dinner

flint idol
#

yeah sorry I forgot to answer

#

ill answer tomorrow or you can read src code

#

src oboskrnl handle.h/c

uncut narwhal
#

thanks!

#

ill read the source and ask more questions if i have em

flint idol
#

oki

uncut narwhal
#

(mostly looking for inspo at this point, ive learned semi-cursed things about zig std hash maps that make them goated for all sorts of weird map-like structures and im sure im going to be using something like that for my nonsense)

flint idol
#

tomorrow

#

I might do a proper devfs

#

like a mountable one

#

I had an idea today

#

for how to do it

slow dove
#

write it down

flint idol
#

rn I have magic functions to register dirents in /dev

#

but

#

and the goal is to change them in some way that makes it not just register in /dev

#

through some sort of literal devfs driver

#

the idea hasn't fully had the time to

#

develop

#

and consolidate

#

hopefully doing this will help me hold steady

#

ive been going in and out of sanity over the past month because of <redacted>

#

I might even implement another congestion control algorithm for obos

#

and in theory after I do that I can merge the tcp congestion control branch

#

and if after that im feeling fine I can fix the xhci driver

#

ive had some theories on why it's broken

#

while im doing that I also might properly implement tcp SACK

#

on obos

#

and by properly implement

#

i simply mean

#

fix bugs with it

#

and i might also try to optimize the tcp stack a bit more

#

and hopefully I will follow through on this instead of bedrotting and being sad

#

sometime between this

#

I might try to fix a longstanding bug in the ps2 driver

flint idol
#

jk im 50% fine

#

50% is heartbroken

uncut narwhal
#

🪦

uncut narwhal
torpid wigeon
flint idol
#

wait until he finds out I dont have tmpfs

#

(technically)

blazing python
flint idol
#

I have tmpfs but only for initrd

#

and ext2

#

which has a 90% chance of corrupting the filesystem if you create a new file

uncut narwhal
#

yknow that sounds like the sort of thing you should fix lmao

dense vigil
flint idol
#

talk cheap meme

uncut narwhal
#

lmao

flint idol
uncut narwhal
#

yeah thatll do it

flint idol
#

do people actually listen to malcolm todd

uncut narwhal
#

idk who that is

flint idol
#

fine shyt told me thats her favorite artists

uncut narwhal
#

oh if musician thats why

#

i listen to this one band from the 70s and thats about it

flint idol
#

I see

uncut narwhal
#

oh and also listen to crane wives

flint idol
#

ur like unc right

uncut narwhal
#

but those are the two

flint idol
uncut narwhal
#

im only 27 but like im into the older music generally

flint idol
#

unc is gender neutral slang i think

#

pretty weird

uncut narwhal
#

if unc is gender neutral then yeah

flint idol
#

if i called my sister unc she wouldn't care

uncut narwhal
#

honestly ive got more unc vibes than aunt vibes despite being a woman

flint idol
#

ok one of these songs is maybe good

uncut narwhal
#

yknow tbh its probably all the handwriting html thats giving me so much unc vibes

flint idol
#

yeah

flint idol
uncut narwhal
flint idol
#

lol

uncut narwhal
#

making me think, does obos have audio drivers yet actually?

flint idol
#

yes

uncut narwhal
#

cool

flint idol
#

its had uhda for quite a long time

#

and I wrote an audio mixer for it in january

uncut narwhal
#

slick

real pecan
#

does uhda work on real hw?

#

since hda is the quirkiest device in existance probably

flint idol
#

cc @white mulch

#

I haven't been able to get it to work on real hardware but at the same time my setup could just be wrong

#

and I haven't been able to get it to work on vbox

uncut narwhal
#

i wonder if i can straight pass through my hd audio device to qemu now

real pecan
#

of course you always could

#

as long as its in a separate iommu domain

uncut narwhal
#

that i dont know how to check lol

#

given i run windows

real pecan
#

oh idk how windows pci passthrough works

#

on linux u just unbind the device from the normal driver and bind it to vfio i think

flint idol
#

yeah that

#

(xhci pass-through flashbacks)

uncut narwhal
#

lmao

white mulch
# real pecan does uhda work on real hw?

depends on the hw, it doesn't really have any quirks implemented except for not using msi on nvidia cards (though iirc most of the quirks have to do with the extra functionality and not so much with basic playback except at least some dma position reporting thing)

real pecan
#

ah cool

white mulch
#

but at least on my laptop that has the intel smartsound technology thing it works (+ at least with passthrough on my pc too)

uncut narwhal
#

so sounds like a fairly standard cid/hid moment where the basic functionality on the cid has fairly few quirks and if you want extra identify based on vendor and devid and shit to get specific with it

flint idol
#

I ended up doing nothing

#

house md took over my prefrontal cortex

weak kestrel
#

more mouse bites

flint idol
#

I feel like thats a reference I should get considering im on season 6

#

btw is season 6 after a month of watching the show a bad thing

weak kestrel
weak kestrel
flint idol
weak kestrel
flint idol
#

im implementing a proper tmpfs

#

one where i can make instances of a tmpfs

inland radish
#

yay!

uncut narwhal
#

tmpfs is just in-memory only fs, yeah?

#

i always forget how that shit works

blazing python
blazing python
uncut narwhal
# blazing python yes

cool. im a general hater of devfs and sysfs so i always forget how the other in-memory fses work

flint idol
trim bay
#

so it still has full POSIX semantics unlike procfs and sysfs

uncut narwhal
tall sluice
#

@flint idol can U explain now?

#

So like

#

destdir is just where the package gets installed to

#

And

#

Bin pkg dir is where the pkg gets created to?

flint idol
#

yes

flint idol
#

also I misunderstood this and thought u meant u would explain lmao

flint idol
#

in hindsight it made a lot more sense for that to have been a typo

tall sluice
flint idol
#

xhci today gdtdoesnotwork

weak kestrel
#

damn everyone is doing nice stuff

#

I gotta step my game up

#

but that's for the future me to worry about

flint idol
#

i implemented some dumb MMIO_WRITEn and MMIO_READn macros

#
#if __x86_64__ || __x86__
#   define MMIO_WRITE8(address, value)\
    asm volatile ("movb %1, %%al;\
                   movb %%al, (%0)"\
                   ::"r"(address),"r"((uint8_t)value)\
                   :"%eax","memory")
#   define MMIO_WRITE16(address, value)\
    asm volatile ("movw %1, %%ax;\
                   movw %%ax, (%0)"\
                   ::"r"(address),"r"((uint16_t)value)\
                   :"%eax","memory")
#   define MMIO_WRITE32(address, value)\
    asm volatile ("movl %1, %%eax;\
                   movl %%eax, (%0)"\
                   ::"r"(address),"r"((uint32_t)value)\
                   :"%eax","memory")
#if __x86_64__ 
#      define MMIO_WRITE64(address, value)\
    asm volatile ("movq %1, %%rax;\
                   movq %%rax, (%0)"\
                   ::"r"(address),"r"((uint64_t)value)\
                   :"%rax","memory")
#   endif /* __x86_64__ */
#   define MMIO_READ8(address)\
    ({\
        uint8_t _result = 0;\
        asm volatile ("movb (%1), %%al;\
                       movb %0, %%al"\
                   :"=r"(_result):"r"(address)\
                   :"%eax","memory")\
     })
#   define MMIO_READ16(address)\
    ({\
        uint16_t _result = 0;\
        asm volatile ("movw (%1), %%ax;\
                       movw %0, %%ax"\
                   :"=r"(_result):"r"(address)\
                   :"%eax","memory")\
     })
#   define MMIO_READ32(address)\
    ({\
        uint32_t _result = 0;\
        asm volatile ("movl (%1), %%eax;\
                       movl %0, %%eax"\
                   :"=r"(_result):"r"(address)\
                   :"%eax","memory")\
     })
#   define MMIO_READ64(address)\
    ({\
        uint64_t _result = 0;\
        asm volatile ("movq (%1), %%rax;\
                       movq %0, %%rax"\
                   :"=r"(_result):"r"(address)\
                   :"%eax","memory")\
     })
#endif /* __x86_64__ || __x86__ */```
dense vigil
#

Then set [[gnu::alwaysinline]]

uncut narwhal
flint idol
#

because i love macro hell trl

dense vigil
#

Pls no macro hell

uncut narwhal
#

lol

dense vigil
#

Your code is barely readable as it already is

flint idol
flint idol
#

i never forced you to

dense vigil
#

True

flint idol
#

i dont even make myself read it

dense vigil
flint idol
#

the function of my code has been lost to time

#

now, only god knows what it does

uncut narwhal
#

you make the constraint "{al}" or "{ax}" or whatever

#

instead of r

#

and then the compiler guarantees goes in that register

dense vigil
uncut narwhal
#

thats what i do for my mmio read/write helpers

dense vigil
#

This is how you have to do it in C

dense vigil
#

I mean I already have it abstracted to functions

#

So it’s like a very fast fix

uncut narwhal
flint idol
#

so this:

    asm volatile ("movb %1, %%al;\
                   movb %%al, (%0)"\
                   ::"r"(address),"r"((uint8_t)value)\
                   :"%eax","memory")```
becomes this?
```c
    asm volatile ("movb %%al, (%0)"\
                   ::"r"(address)\
                   :"%a"(value),"memory")```
dense vigil
#

And it has to be mov

blazing python
flint idol
#

yes

blazing python
# flint idol yes

did you know you can just check in qemu is compiler doing some shit

flint idol
#

yes

#

i did know

uncut narwhal
dense vigil
flint idol
#

wow thanks how fucking useful

uncut narwhal
flint idol
dense vigil
#

Idk if clang has it either

dense vigil
flint idol
#

its fine

uncut narwhal
dense vigil
#

Damn

#

It should be like a capital A I think

flint idol
#

clang doesn't like it

dense vigil
#

For legacy constraints

uncut narwhal
#

isnt capital A for the weird eax:ecx thing?

flint idol
#
asm volatile ("movb %%al, (%0)"\
             ::"r"(address),"A"((uint8_t)value)\
             :"memory")```
this worked
uncut narwhal
#

cool

flint idol
#

so did lowercase a

#

no clue if it does what i want it to

dense vigil
flint idol
#

ill check with godbolt

dense vigil
#

Yeah it’s lowercase

dense vigil
uncut narwhal
#

yeah lowercase

dense vigil
#

Idk why they ever made the fucking syntax this ass

#

💀

uncut narwhal
#

capital A is for the eax:edx combo thingies but only on x86_32, it doesnt work on x86_64 ime

flint idol
#
MMIO_WRITE8(0x1000, 0);```
becomes this
```x86asm
        mov     edx, 4096
        mov     eax, 0
        movb %al, (edx)```
#

which looks about right

uncut narwhal
#

yeah that looks right

uncut narwhal
# dense vigil Maybe?

correction, capital A is for things that return a dword in ax:dx and not for things that return a qword in eax:edx lmao

dense vigil
#

Damn

#

Again who the fuck decided this syntax was good

blazing python
#

virgins use some mmio_write when real chads use volatile

uncut narwhal
uncut narwhal
dense vigil
#

Intel allows crazy shit on MMIO too

uncut narwhal
dense vigil
#

You can xor a register apparently and crap if you wanted

flint idol
#
#   define MMIO_READ8(address)\
    ({\
        uint8_t _result = 0;\
        asm volatile ("movb %0, (%1)"\
                   :"=a"(_result):"r"(address)\
                   :"memory");\
        (_result);\
// ...
    uint8_t res = MMIO_READ8(0x1000);
     })```
became this:
```x86asm
        mov     eax, 4096
        movb al, (eax)```
#

which also looks right

uncut narwhal
#

yep

dense vigil
#

Somebody dosnt wana support this

uncut narwhal
#

you might be able to do some shit with the constraints to let it pick a more efficient™ memory addressing scheme but idk which ones are allowed for mmio and also idk the fuckin non-register contraints anyway im too stupid for that shit

uncut narwhal
#

i googled amd ppr and got this document from 2025 from them

dense vigil
#

What does configuration in this scenario mean?

real pecan
#

ECAM

uncut narwhal
#

yep

flint idol
#

fsdfsdpoi MMIO_WRITE32 doesn't compile

uncut narwhal
#

currently my kernel doesnt have generic mmio helpers, only ecam ones

flint idol
#
#   define MMIO_WRITE32(address, value)\
    asm volatile ("movl %%eax, (%0)"\
                   ::"r"(address),"a"((uint32_t)(value))\
                   :"%eax","memory")```
#

"Asm-specifier for input or output variable conflicts with asm clobber list"

#

blah blah

#

just compile it

uncut narwhal
#

at the end

dense vigil
flint idol
#

oops

#

forgot to remove it

#

3rd force push of the day

#

:D

uncut narwhal
flint idol
#

time

#

to

#

convert

#

EVERY

#

mmio access

#

for xhci

#

to use the macros

uncut narwhal
flint idol
#

no PCIe on obos yet

uncut narwhal
#

ah you still only using the io ports? in that case yeah not yet

dense vigil
#

Why aren’t you using pice for xhci??

flint idol
#

pice

#

never heard of 'em

flint idol
#

send pcie

dense vigil
#

I don’t have pcie yet

flint idol
#

do u even have pci

dense vigil
#

Nah

#

I don’t even have a working VFS yet

#

💀

blazing python
flint idol
#

giopsfdjs

blazing python
#

because some hw can forgive something other not

torpid wigeon
flint idol
#

if it has a haswell cpu then it might

#

haswell is 2013 era

#

cpu

blazing python
flint idol
#

maybe

torpid wigeon
#

linux ignores this "problem" entirely btw

flint idol
#

ill send iso

flint idol
torpid wigeon
#

then why do you need to care

flint idol
#

because dumb cuck amd says i do

dense vigil
#

And linux could very well have issues on certain weird ass hardware configs due to this problem technically

flint idol
#

obos doesnt even boot on any amd hardware

#

maybe i dont need to care

torpid wigeon
#

yet nobody is complaining so this seems like huge larp

#

and complexity that nobody cares about

blazing python
flint idol
#

no

#

that's way too much work

dense vigil
#

I mean it’s still better than doing mmio->register and crap which is what OBOS does rn

torpid wigeon
#

it's not

dense vigil
#

Can’t that generate certain memory accesses not proper for registers?

#

Even if volatile

blazing python
uncut narwhal
#

tbh for my kernel im doing mmio_write stuff more because i have a pathological distrust of the volatile keyword than because of this amd edge case that may or may not be real

#

its just that i can do like one letter different and never have to worry about whatever amd does again either in the process

torpid wigeon
#

volatile has some issues yes

#

but yes being able to read an entire struct with mmio at a time is kinda nice

uncut narwhal
#

i probably dont need to distrust volatile so much i just kinda do lmao

torpid wigeon
#

gcc has some details

uncut narwhal
#

yeah reading whole structs is def a point in favor of using mmio pointers

torpid wigeon
flint idol
#

consistent too

torpid wigeon
#

rip

flint idol
#

lmao

#
pi->usb3 = (((*dw0) >> 24) & 0xff) == 0x3;```
#

faults here

#

hm

#

shrx what the fuck is that instruction gcc

#

"shift without affecting flags"

#

@torpid wigeon THIS is why you use inline assembly mmio macros

torpid wigeon
#

what's the problem

flint idol
#

kvm doesn't shrx being used for mmio

#

gcc emitted that for fun instead of mov

torpid wigeon
#

is dw0 volatile?

flint idol
#

i forgor

torpid wigeon
#

bro

uncut narwhal
#

bro...

blazing python
#

bro

flint idol
#

i think it's time to go

uncut narwhal
#

im on the pro-mmio-helpers side and i cant defend that lmao

flint idol
#

now

#

fslkfnmsd

flint idol
#

(ignore giant iso size)

blazing python
flint idol
#

ig server boost

torpid wigeon
#

@flint idol did volatile dw0 fix the codegen

flint idol
#

i invoke my right to remain silent

#

i will not speak without a lawyer

#

-# trl

uncut narwhal
#

lmao

flint idol
#

with more logs enabled

blazing python
#

on my main pc it hangs there

flint idol
#

obos never booted on amd

#

never figured out why

#

probably never will, i dont own amd hardware

#

unless of course, patches sent

uncut narwhal
flint idol
#

52 and 9

uncut narwhal
#

theres a bit in the pte thats ignored on intel and reserved-must-be-0 on amd thats actually checked for

flint idol
#

bit 9 is used for swap stuff, bit 52 is used to lock virtual memory (which is not done anywhere in the kernel, it only exists for the mlock and munlock syscalls)

flint idol
#

it has debug logs

uncut narwhal
#

(page directories and up arent allowed to have the global bit set on amd)

flint idol
#

ic

uncut narwhal
#

only bottom level page entries are allowed to have that bit set

#

its ignored on intel so you can make your entire kernel tables have it set on their cpus

flint idol
#

i see

#

well i dont use it at all

#

as of today

#

(i might soon for optimization but idk)

uncut narwhal
#

so that isnt why obos dies on amd then lol

flint idol
#

nope

#

god knows why it dies on 99.9% of all x86 hardware

#

on my pc it gets a bit past lapic init

#

and hangs

#

on timer stuff

#

at first i thought that i should make an x2apic driver to fix it but that didn't do anything

blazing python
# flint idol

on my old laptop with celeron it just triple faults

flint idol
#

which could mean

#

my x2apic driver is broken

flint idol
#

that's sad

#

ill put it on my list of known broken hardware

#

(it is now 54983 entries long)

real pecan
#

i remember times when obos had proper suspend and resume

flint idol
#

same

#

no clue what happened

#

(time to do a git bisect of 700 commits trl)

blazing python
#

obos prime is end

flint idol
short mortar
#

i need to fix my suspend and resume trl

uncut narwhal
#

i should do suspend/resume someday

torpid wigeon
#

TIL obos has more rewrites than i do

weak kestrel
flint idol
#

no

flint idol
dense vigil
flint idol
torpid wigeon
#

i have had 2 rewrites

uncut narwhal
#

ive had one atm

torpid wigeon
#

c -> rust -> c (zinnia)

flint idol
#

for those who want to look at it for reference

uncut narwhal
#

neat

flint idol
#

its that something regressed somewhere else that causes suspend not to work properly

flint idol
#

just the framebuffer does die on S3 suspend

#

on most hardware

flint idol
#

if i get 60 stars today I will fix the bugs with obos booting on my pc

#

(5:30 hours until the offer is down)

uncut narwhal
#

stars on the thread?

flint idol
#

yes

#

50 stars on the gh i will actually lock in for xhci

uncut narwhal
#

dang beat me to it, i just joined hte server on my alt to be the 60th lmao

#

but it wont let me react on the alt yet for some reason

#

apparently the 10 minutes before you can post also applies to reacting on threads

flint idol
#

Sunday at the latest

astral mason
#

I'll hold you to that >:3

flint idol
flint idol
#

thx

#

re: my stupid syscall table code, I documented me doing it here lmao

#

wow how did i do this from 8 to 11 every day what

#

pretty much every obos native program doesnt use the native syscall api lol

flint idol
#

due to foreseen circumstances, I will have to delay fixing real hardware bugs by a few days

#

(I installed bmc4)

flint idol
#

guys

#

it is with great dismay

#

i announce the next rewrite of obos

#

because of its terrible instability

#

the new rewrite will be written in rust to aid in memory safety

#

and it will target aarch64 as it's main arch

#

and will run on primarily iphones as a replacement to ios

#

but will also provide full android binary compatibility

weak kestrel
#

It would have been believable if not for the last two lines

flint idol
#

@dense vigil

dense vigil
#

Why aarch64

flint idol
#

for iphone compact

#

compat*

dense vigil
#

You need to do the architecture for the Apple newton

#

Duhhhh

flint idol
#

right

#

okay

#

the rewrite will also not support x86

#

and will not support any cisc arch

dense vigil
#

Will you do ppc32be

flint idol
#

maybe

#

that's the second port i will do

#

i will start the rewrite in a few hours, godspeed

inland radish
#

therefore i can't run your OS on any of them

#

oops! 😊

flint idol
#

oh no!

#

what a shame

flint idol
#

btw i'm taking a long break from osdev

#

probably until i beat the bmc4 mod

torpid wigeon
#

bruh

stark hamlet
#

6th rewrite incoming

flint idol
#

havent beat bmc4

#

but

#

tmpfs dev has been happening in the meantime

#

and this lol

#

VNODE_TYPE_CHR trl

#
switch (vn->vtype) {
    case VNODE_TYPE_LNK:
        *t = FILE_TYPE_SYMBOLIC_LINK;
        break;
    case VNODE_TYPE_REG:
        *t = FILE_TYPE_REGULAR_FILE;
        break;
    case VNODE_TYPE_DIR:
        *t = FILE_TYPE_DIRECTORY;
        break;
    default: OBOS_UNREACHABLE;
}
#

stats /root/test
create_vnode called on /dev/tty0
?????

uncut narwhal
flint idol
#

what the actual fuck

#

(what is "test")

#

(p is /root)

#
enum {
    // This dirent hard links to the controlling tty of the process
    DIRENT_REFERS_CTTY = BIT(0),
    DIRENT_TMPFS_FILE_MOVED = BIT(0),
};```
#

oh

uncut narwhal
#

well that dont look right

flint idol
#

ok u can now do this in the tmpfs thing:

mv ./test ..
mv ../test .```
#

however u cannot:

mv test ..
nano test```
#

oh wait

#

fixed it

#

file removal also works

#

time to test xorg

#

nvm i have smth else to fix

#

it hangs when u want a login prompt

dense vigil
#

Just don’t give a login prompt

flint idol
dense vigil
#

Who needs thoes anyways

flint idol
#

hm interesting it writes to stderr but nothing comes out the other end

#

and read hangs

#

wait bash calls wait process then execs into /usr/sbin/logic

#

weird

#

what was it waiting on

#

oh

#

im dumb

#

i configured this build to put the login prompt on /dev/ttyS0

#

and forgot lol

#

xorg works with the new tmpfs

#

lol i just have some random binary called test in my initrd that accesses the network and i have absolutely no idea what it does

dense vigil
#

💀

#

Time to reverse engineer it?

#

First OBOS virus?

flint idol
#

it ||is just a test of tcp keepalive that i wrote and forgot about||

dense vigil
#

Ah

#

How is TCP going bye?

flint idol
#

i committed tmpfs

dense vigil
#

Btw

flint idol
#

havent worked on this in like 1.75 months

flint idol
dense vigil
#

Oh

#

That was a fix to typo

flint idol
#

oh trl

dense vigil
#

What about XHCI

flint idol
#

u can now mount devfs in different places

#

!!!

#

i have no clue what will happen if u say

#

write to the same block device at different paths

#

but let's just hope nothing funky happens

#

ok well since they have the same vnodes, it should work just like a hardlink

#

ok but since dirents aren't synced

#

if u do something like this:

cd ~
mkdir dev
mount -s devfs dev
cd dev
mkdir funy
ls 
ls /dev/
rmdir funy
ls funy # nothing happens here except ENOENT
ls /dev/funy # it page faults here
#

which i actually only think will happen with directories

#

with files it just doesn't notice that the file is gone

#

and does random bs with the file that doesn't exist anymore

flint idol
#

i added some code to make it check if the file exists before returning the dirent

#

in the dirent lookup code

flint idol
#

but

#

the populate directory thing isnt smart enough to get rid of dirents that don't exist anymore

#

so just ls will still show deleted files

flint idol
#

that actually might be quicker than my other idea which was to mark all entries as FREED and if it's found while asking the fs driver for the dirents, the FREED marker is taken off

flint idol
#

i can't nuke each entry

#

in populate directory

#

because then entries that are directories will have children that refer to non existent parents

#

and memory bugs and blah blah blah

flint idol
#

overlays work

#

u can do mount -o /dev/sdb1 /mnt and do whatever you want

#

and sync

#

and /dev/sdb1 will not be affected

#

uh nvm overlays may not work

#

lmao

#

i fixed that

flint idol
#

i hate when im hyperfixated and the surge of dopamine is in my brain then someone calls me and tells me to do something

#

jgljksdjhnfdas;lkfdsfasdqw

#

edwqrfokewjruesdhgltkendr;lhgtred

uncut narwhal
#

yeah that sort of thing fucks up the entire flow

flint idol
#

(prefrontal cortex)

#

actually brain is very interesting

#

probably might study that thing after high school but who knows

flint idol
#

oh nice

#

unmounting doesn't work anymore

#

lmao

#

mounting a normal tmpfs also works

#

all i really have to do atp is to strip down the initrd driver's code to make it RO

#

like it was before i added the weird tmpfs bs to it about a year ago

#

and speaking of years, this obos rewrite is almost 2 years old

flint idol
#

i wonder how that happened...

torpid wigeon
#

bruh

flint idol
#

i fixed it

#
diff --git a/src/oboskrnl/vfs/dirent.c b/src/oboskrnl/vfs/dirent.c
index 12363ba..e1837a6 100644
--- a/src/oboskrnl/vfs/dirent.c
+++ b/src/oboskrnl/vfs/dirent.c
@@ -103,7 +103,8 @@ static dirent* on_match(dirent** const curr_, dirent** const root, const char**
             return cur_thr->proc->session->controlling_tty->ent;
         }
 
-        if (!only_cache)
+        bool vnode_is_drv = curr->vnode && (curr->vnode->vtype == VNODE_TYPE_DIR || curr->vnode->vtype == VNODE_TYPE_REG || curr->vnode->vtype == VNODE_TYPE_LNK);
+        if (!only_cache && vnode_is_drv)
         {
             dev_desc desc = 0;
             driver_header* header = Vfs_GetVnodeDriver(curr->d_parent->vnode);
@@ -285,7 +286,7 @@ static dirent* lookup(const char* path, dirent* root_par, bool only_cache)
     size_t currentPathLen = 0;
     vdev* fs_driver = lastMount->fs_driver;
     mount* mountpoint = lastMount;
-    dirent* last = root_par;
+    dirent* last = Vfs_GetRoot() == root_par ? mountpoint->root : root_par;
     while (tok < (path_mnt+path_mnt_len))
     {
         char* token = Vfs_Calloc(tok_len + 1, sizeof(char));
#

the fix btw

uncut narwhal
#

🎉

flint idol
#

ffs

#

noip is so annoying

#

they won't give me my dns record

#

remind me on the 22nd to get my hostname back

#

someone

#

kthx

flint idol
#

i made a side quest

#

and the ext2 driver now sets the right flags on mount and unmount

#

in the superblock

#

i eventually want to get /etc/mtab existing

#

i think ill either do some sort of sysfs-like thing for that

#

or ill get the mount and umount commands doing funny bs to get it to look like it works

#

i might look at fixing TCP selective ACK rn

#

as that is my only setback to merging tcp-congestion-ctrl iirc

#

if only i remembered

#

how the retransmission queue worked

#

whoever wrote this code was probably high on copium

#
tcp_sequence_rng_list rtxq;```
well it's just a list of TCP sequence ranges
#

it would be a lot easier to fix the bug with SACK if i remembered what the bug was...

#

this man was insane

flint idol
#

im getting man-db to work

#

and i was able to get it to not hang anymore

#

but this

#
[ DEBUG ] (thread 60, process 48) syscall Sys_ExitCurrentProcess(0xff, 0x0, 0x0, 0x0, 0x0)```
#

some process decided it wanted to be funny and exit with an error status

#

it calls getpid() then exit(-1)

#

because it thinks it's funny

#

oh it calls execve a few times before giving up on life

#

interesting

flint idol
real pecan
#

why does exit current process have 4 damn arguments

flint idol
#

it doesn't

#

the syscall logger is too lazy to know what arguments actually exist

#

so it prints all 5 registers

real pecan
#

lol

flint idol
#
OBOS_Debug("(thread %ld, process %ld) syscall %s(0x%p, 0x%p, 0x%p, 0x%p, 0x%p)\n", Core_GetCurrentThread()->tid, Core_GetCurrentThread()->proc->pid, syscall_to_string[eax], rdi,rsi,rdx,r8,r9);
#

oh man-db wants /bin/sh

#

for nroff

#

well it does indeed have /bin/sh

#

but the leading space caused my execve implementation to mess up

#
#! /bin/sh```
#

(it still doesn't work)

#

i swear man-db is the most retarted program ever developed

#

how tf do i run gcc but not man-db

#

some stupid fuckass program in the pipeline that man-db starts

#

is supposed to convert the man page to smth readable

#

but NOOO

#

it outputs nothing to the pager

#

not even

#

it doesn't even write to a pipe

#

with anything

#

i think nroff is the culprit

#

groff is actually fucking retarted what

#

"prevent destructor from recursing"

#

wtf

#

how tf is fflush returning ENOENT???

real pecan
#

obos stability strikes again

weak kestrel
#

lmao

flint idol
#

Sys_FdFlush

#

isn't

#

even called anywhere

#

😭

#

mlibc seems to be hallucinating errors from fflush

#

although fflush might not call fsync now that i think about it

#

the EC im getting from groff

#

is a bug

#

ENOENT is from an old errno value

flint idol
#

or does it wait what?

#

fflush doesn't seem to set errno in mlibc unless im mistaken

#

right so i love how

#

fd 1 in some process started by nroff

#

is a pipe

#

but there is no handle clone/fcntl syscall

#

changing stdout to a pipe

#

dxscfsdfs

#

i can run xorg and gcc but not fucking groff the game is rigged against me sdafjsdklpfjdms

#

ok so far i see that it does this:

pipe(&fds);
fork();
fork();```
#

and that's the only time a pipe is even created

#

how is fd 1 a pipe

#
[ DEBUG ] (thread 58, process 46) syscall Sys_IsATTY(0x1, 0x0, 0x0, 0x0, 0x0)
[ DEBUG ] (thread 58, process 46) syscall Sys_IsATTY returned 0x27 (OBOS_STATUS_NOT_A_TTY)
[ DEBUG ] (thread 58, process 46) syscall Sys_FdSeek(0x1, 0x0, 0x1, 0x0, 0x0)
[  LOG  ] (thread 58, process 46) syscall Sys_FdSeek returned 0x2f (OBOS_STATUS_SEEK_UNALLOWED)
[ DEBUG ] (thread 58, process 46) syscall Sys_FdTellOff(0x1, 0x0, 0x0, 0x0, 0x0)
[ DEBUG ] (thread 58, process 46) syscall Sys_FdTellOff returned 0x0 (OBOS_STATUS_SUCCESS)
[ DEBUG ] (thread 58, process 46) syscall Sys_FdWrite(0x1, 0xef4008, 0x97, 0x8b6588, 0x0)
[ DEBUG ] pipe.c:write_sync: closed pipe
[  LOG  ] (thread 58, process 46) syscall Sys_FdWrite returned 0x21 (OBOS_STATUS_PIPE_CLOSED)
#

fd one is a pi

#

pe

#

yet

#

a pipe is never put on fd 1

#

im gonna stop repeating myself and debug ts

#

ill just ignore that

#

i believe the 2nd child of groff owns the reading end

#

only problem is uh

#

that process dies before the write ever happens

#

all that process does is:

  • start
  • execve
  • check if fd zero is a pipe
  • check if fd one is a pipe
  • exit
#

wait

#

it reads from fd zero

#

but the read is successful

#

despite the pipe being empty

flint idol
#

i think i fixed pipes finally

#

cuz i got groff to work

#

i spoke too soon

#

nroff works but noooo man-db doesn't

inland radish
flint idol
#

syscalls have 5 parameters yes

inland radish
#

i'm out here with 9 parameters max

flint idol
#

damn

inland radish
#

(though on i386 i have to work around the lack of gprs so i end up doing some extra stuff)

flint idol
#

has that ever been proven useful

inland radish
flint idol
#

if i need more than 5 arguments i just have the last one a pointer to a struct with the extras

short mortar
#

I use uint64_t for everything, so all of my syscalls are super long on ia32

inland radish
short mortar
#

But I also have syscalls that take like 10 uint64_t's

inland radish
#

(8 on 32-bit because there's one 64-bit argument)

#

behold:```c
BSTATUS OSWriteFile(PIO_STATUS_BLOCK Iosb, HANDLE Handle, uint64_t ByteOffset, const void* Buffer, size_t Length, uint32_t Flags, uint64_t* OutSize);

short mortar
#

But I just pass a struct to kernel because it's too much

inland radish
#

runners up:

BSTATUS OSMapViewOfObject(
    HANDLE ProcessHandle,
    HANDLE MappedObject,
    void** BaseAddressInOut,
    size_t ViewSize,
    int AllocationType,
    uint64_t SectionOffset,
    int Protection
); // 7 parms
BSTATUS OSCreateSymbolicLink(
    PHANDLE OutFileHandle,
    HANDLE DirectoryHandle,
    const char* FileName,
    size_t FileNameLength,
    const char* TargetName,
    size_t TargetNameLength
); // 6 parms
BSTATUS OSCreateThread(
    PHANDLE OutHandle,
    HANDLE ProcessHandle,
    POBJECT_ATTRIBUTES ObjectAttributes,
    PKTHREAD_START ThreadStart,
    void* ThreadContext,
    bool CreateSuspended
); // 6 parms
short mortar
weary hound
#

i think in managarm it's at most 7 args (6 in + 1 out), for helCreateThread and helMapMemory ```c
HelError helMapMemory(
HelHandle handle,
HelHandle space,
void *pointer,
uintptr_t offset,
size_t size,
uint32_t flags,
void **actual_pointer);

HelError helCreateThread(
HelHandle universe,
HelHandle address_space,
HelAbi abi,
void *ip,
void *sp,
uint32_t flags,
HelHandle *handle);

flint idol
#

interesting

#

my biggest syscall is probably mmap

#

it has 5 physical parameters but one is a pointer to a struct with 3 fields as 3 extra parameters

weary hound
#

a space within which handles exist

#

threads have an universe attached in which handles used by that thread are resolved, and the universe can also be manipulated by the holder of the handle to it

#

this is used by e.g. posix-subsystem to give file stream handles to processes, which on open inserts a handle to the stream into a process' universe, then writes the new handle into shared memory that maps fd->handle

real pecan
#

Holy

#

Whats HelAbi?

weary hound
#

currently always kHelAbiSystemV (1) :^)

real pecan
#

Ah

#

Is this really needed? Cant other abis emulate sysv for system calls

weary hound
#

yeah the kernel doesn't really make much use of it

#

in the future ig one use could be if we want to provide linux syscall emulation or whatever, the abi could be used to disable native syscalls and make all syscalls become observations

real pecan
#

I see

real pecan
#

So its more like personality

weary hound
#

i guess, but nothing's been decided yet

real pecan
#

Fair

weary hound
flint idol
#

another day

#

another agonizing debugging session of man-db

real pecan
#

can obos survive a fork bomb

flint idol
#

who knows

#

the answer: no

#

it hangs

weak kestrel
real pecan
#

lol

flint idol
#

but it is rendered inoperable

#

as there is nothing u can do to kill the fork bomb

#

libpipeline is so stupid i hate libpipeline

weak kestrel
#

it also hangs

flint idol
weak kestrel
#

I'm not sure

real pecan
flint idol
#

i dont think so

#

it could've OOMed, or the kernel could be aggressively swapping and i have no idea

#

man-db is so dumb what

#

for some reason

#

zsoelim and manconv

#

completely nuke the input manpage

#

which is one of the reasons why man-db isn't working

knotty totem
#

mandoc ❤️

flint idol
#

atp i might as well port mandoc instead

flint idol
#

i swear this was implemented though?

flint idol
#

BIG

#

man ls.1 doesnt work but who cares!!

flint idol
#

todo fix more bugs today

flint idol
#

i don't use ai for obos at all

#

but i'm keeping it here because i can't be damned to move it

uncut narwhal
#

mood

#

tbh if i didnt want to reorganize my top post and add a pinboard message i wouldnt have bothered for mine either

flint idol
flint idol
#

as expected, this does not happen on linux mlibc

flint idol
#

maybe more debugging today

#

OBOS (not vibe coded)

blazing python
#

i thought obos was like vibos

short mortar
#

vibes trl

#

Lol, what if I start a vibecoded os in some cursed language or something as a second project?

#

(though now that I think of it, it's a bar idea)

flint idol
#

OBOS (not vibecoded)

flint idol
#

maybe debugging today?

real pecan
#

No

#

New features

blazing python
honest citrus
weak kestrel
#

zig rewrite

blazing python
#

rust rewrite

short mortar
#

c++ rewrite trl

torpid wigeon
#

c rewrite

real pecan
#

ada rewrite

blazing python
#

v rewrite

uncut narwhal
#

lol

uncut narwhal
flint idol
#

no debugging today

#

😔

real pecan
#

Rust rewrite day

uncut narwhal
#

lmao

uncut narwhal
weak kestrel
#

porting systemd day

dense vigil
#

Taking a break and not overworking yourself day?

torpid wigeon
#

whne c rewrite

blazing python
#

when hoi4 port

real pecan
#

Jai when

flint idol
#

when there is much easier forms of dopamine to be found

uncut narwhal
#

the nice thing with hobby projects is theres no deadline lol

flint idol
#

real lol

flint idol
flint idol
#

i have to have motivation for this project considering ive already dropped 20 dollars on it

#

fucking canada post is a scam

#

15 dollars shipping for a 5 gram package

real pecan
#

what did u buy

flint idol
#

intel 8086

flint idol
#

(for reference i can ship in two ICs from china for $8)

lean glen
#

whats annoying with the 8086 and stuff is you have to find a bunch of components and they're not getting made anymore

#

I've found sellers on ebay selling a bunch of pc components

#

but its annoying

#

not like the 6502

flint idol
#

ye

#

but im really bored

#

soo

lean glen
#

I have designed a few computers but never built one

flint idol
#

with 8086?

lean glen
#

itd be nice to do it but it's easily like 200$

lean glen
flint idol
#

ic

lean glen
#

8086 might be a pita

#

i wouldnt do it

flint idol
#

perhaps

#

i should MAYBE cancel my order before it gets shipped and it's too late

lean glen
#

yeah

#

do 8088 honestly

#

much simpler board design

lean glen
uncut narwhal
#

i wish zig had 6502 support tbh. (or actually 65c816 tbh), id design up a machine for that happily to play with

flint idol
#

m68k trl (/j)

flint idol
#

ill probably start the design of the 8088 thing rn

uncut narwhal
#

(side note that someone managed to snipe issue #6502 for the git issue tracking 6502 support for zig and i find that hilarious)

lean glen
#

do you wanna build a PC compatible?

#

if so you'll need a bunch of components

#

id rather do something like 6502 which is boring but its readily available

weary hound
#

very topical, i just ordered a pcbs from jlcpcb for my 65816 project :^)

lean glen
#

nice

#

but yours is a fpga right

flint idol
#

i just need a side project that will keep occupied for a while even if im not actively doing it

weary hound
#

plus passives

weary hound
lean glen
#

ah

#

I guess you could do that with 8088 too

#

emulate the PC chips in the fpga

weary hound
#

yeah i don't see a reason why this wouldn't be possible with other cpus

lean glen
#

idr the name

#

faraday

real pecan
flint idol
#

not be bored

#

duh

real pecan
#

Like eat it, destroy it, port obos to it or

lean glen
#

I dont think its really feasible to port an OS to a breadboard computer

#

because as soon as you add an mmu it gets very messy

flint idol
#

prob just write some code to drive it

knotty totem
#

I think there's even been a 3 or 486 project maybe?

lean glen
#

which is not cheap nor readily available

knotty totem
#

I mean it's not super cheap but it is doable

#

There might be cheaper ones on aliexpress, but last I tried looking it was so hard to find anything actually related to what I want 🙄

flint idol
elfin belfry
flint idol
#

id have preferred if one of them were active high for simplicity's sake

#

as now i need both a RD and WR signal on the bus

elfin belfry
#

well, flash memory ICs have them active low too

flint idol
#

although maybe that's standard of most chips

#

it seems like i'd have needed such a signal anyways

#

for my rom

#

whatever

#

it's probably not that deep

lean glen
flint idol
#

but i like active high

#

anyway

flint idol
flint idol
#

i wonder whether i should disable EEPROM writes in my bus logic

#

and by that i mean just tying #WE high on the EEPROM

#

instead of connecting it to the bus #WR signal

elfin belfry
#

i don't think you should use eeprom as write mem on your pc

#

but use a flash instead

flint idol
#

i see, any particular reason?

elfin belfry
#

eeprom doesn't like being re-writted that often

#

it will prob die quite fast compared to flash

flint idol
#

okay

weary hound
#

WE# = or(WR#, ~enable FF)

#

then have the FF be writable through a bit on some io port or w/e

flint idol
#

that's a good idea

#

i'll probably include that logic in my circuit

weary hound
#

alternatively i'd just make it a jumper on the pcb ig

#

between high or WR#

flint idol
#

that also would work

#

but i like the io port idea better

#

i'm drawing out the bus logic on a piece of paper rn and i'm gonna put it in my schematics later

#

i'm also gonna have to make sure my clock logic is sound

#

as rn it's just a passive oscillator connected to an 8284

#

and the output of the 8284 is connected to the 8088

weary hound
#

are you gonna use any programmable logic or just generic logic chips

flint idol
weary hound
#

ah

flint idol
#

i've completed the memory space address decoding logic

#

it wasn't too difficult, address lines 16-19 are NANDed to produce CS for ROM, and inversed for the RAM CS

uncut narwhal
#

nice

#

you get one of those nand gates with both inverted and noninverted inputs?

flint idol
#

and then there is some more logic in the ram because i am using two 32K RAM chips to address 64K of ram

flint idol
#

this is what i came up with on paper

#

for the ram decoding thing

#

not the prettiest sketch

#

but i've drawn worse

uncut narwhal
#

most important is can you read it lol

flint idol
#

yea lol

#

i've implemented this in my drawing

#

but i realized rn that in my schematic

#

i completely disregard the IO/M pins

#

pin*

#

which means that all bus accesses are treated as memory accesses

#

in my sketch the logic exists

#

but not in my schematic so i'm gonna have to fix that

flint idol
#

i did put it in the schematic

flint idol
#

i just double checked my schematic

#

and the logic seems sound

flint idol
#

for today i will be drawing out the logic for the I/O ports

#

i think i will just have address lines 15 thru 8 determine the device selected

#

with each bit acting like a flag

#

oh right this is obos thread lol

#

whatever

#

obos port to 16 bit arch trl

#

i also wrote this silly little rom

#

for when/if i build the thing

#

oh come on i'm gonna need a flash programmer

#

damn it

#

where am i supposed to get that

#

oh wait amazon

dense vigil
#

If it’s a DIP chip and a parallel flash rom

#

It’s really easy ish

flint idol
flint idol
#

i just wrote a flash programmer for the ROM i'm gonna use

flint idol
#

oh thank the lord

#

thank god