#OBOS (not vibecoded)
1 messages · Page 44 of 1
You can have a program interpret the noises
So when you play a diffrent note it does a different action
oberrow is the younger version of dwl
thats the guy on the cherno server who deleted his account right
dreaming warlord or smth
lol yeah but hes back
ah
the cherno 💀
What’s the cherno
C++/game YouTuber
Probably
I’ve long left tutorial hell though thankfully
he makes/made c++ tutorials
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
yeah i remember him being ass lol
somewhat (un)related but i wonder how people dont understand variables in programming languages
its like math variables
what
idk some beginners have problems with them for some reason
sure, fine with the uint's and ints and other types
but the variables themselves idk
ive never met such a person
His biggest thing was game engine series
it's not
me when const variables in math
also x = x + 1 would probably give a heart attack to a mathematician
Cc @barren merlin 
x += 1 
Eh
They would say the set of solutions is the empty set
I learnt programming from him
J feel like he used a lot of time explaining things that could be explained in half the time
@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
ill explain after dinner
yeah sorry I forgot to answer
ill answer tomorrow or you can read src code
src oboskrnl handle.h/c
oki
(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)
tomorrow
I might do a proper devfs
like a mountable one
I had an idea today
for how to do it
write it down
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
if only I had theories on why im broken 
jk im 50% fine
50% is heartbroken
🪦
oh btw your handle source was very clear and understandable, no further questions at this time
devfs is just a tmpfs singleton
what filesystems you have now
I have tmpfs but only for initrd
and ext2
which has a 90% chance of corrupting the filesystem if you create a new file
yknow that sounds like the sort of thing you should fix lmao
Nah I love playing Russian roulette with my file system
talk cheap 
lmao
which may also be in part due to the fact that the kernel might crash while creating the file leaving changes half-synced to disk
yeah thatll do it
do people actually listen to malcolm todd
idk who that is
fine shyt told me thats her favorite artists
oh if musician thats why
i listen to this one band from the 70s and thats about it
I see
oh and also listen to crane wives
ur like unc right
but those are the two

more like aunt but yeah
im only 27 but like im into the older music generally
if unc is gender neutral then yeah
if i called my sister unc she wouldn't care
honestly ive got more unc vibes than aunt vibes despite being a woman
ok one of these songs is maybe good
yknow tbh its probably all the handwriting html thats giving me so much unc vibes
yeah
yes for the most part this shit is ass
https://www.youtube.com/watch?v=jRwmkZ49jVM this is the shit i listen to lmao
Provided to YouTube by Esoteric
A Song For All Seasons (2019 Remaster) · Renaissance
A Song For All Seasons
℗ 1978 Cherry Red Records Ltd Cherry Red Records Ltd
Composer: Betty Thatcher
Composer: John Tout
Composer: Jon Camp
Composer: Michael Dunford
Composer: Terence Sullivan
Auto-generated by YouTube.
lol
making me think, does obos have audio drivers yet actually?
yes
cool
slick
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
i wonder if i can straight pass through my hd audio device to qemu now
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
lmao
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)
ah cool
but at least on my laptop that has the intel smartsound technology thing it works (+ at least with passthrough on my pc too)
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
more mouse bites
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
it's a meme
i made this voice over, which was a dub of someone else VO. the gif is really old though. unfortunately i unlsited this video after i made cause i was doing other things, but i honestly didnt realize it blew up on someone else's channel.
inspiration: https://www.youtube.com/watch?v=OqT1UHI6JKQ&ab_channel=MKN
considering I finished 7 season star trek show in like 3 weeks, idk
lmfao
Which one?
all of them 
yay!
yes
do tree tmpfs
cool. im a general hater of devfs and sysfs so i always forget how the other in-memory fses work
I dont think there are many other alternatives
yeah, the usual implementation is that you never evict any data from the page cache and hold an extra reference to every namecache entry until that entry is unlinked
so it still has full POSIX semantics unlike procfs and sysfs
so i dont know anything about namecache but the rest makes sense
@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?
yes
also I misunderstood this and thought u meant u would explain lmao
ohhhh
no
mb
xD
in hindsight it made a lot more sense for that to have been a typo
it was a typo 😔
xhci today 
damn everyone is doing nice stuff
I gotta step my game up
but that's for the future me to worry about
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__ */```
Why not a static inline function here?
Then set [[gnu::alwaysinline]]
couldn't you just constrain value to use the a register?
because i love macro hell 
Pls no macro hell
lol
idk how inline assembly works
so don't read it
i never forced you to
i dont even make myself read it
You can set register constraints yes
you make the constraint "{al}" or "{ax}" or whatever
instead of r
and then the compiler guarantees goes in that register
Machine Constraints (Using the GNU Compiler Collection (GCC))
thats what i do for my mmio read/write helpers
This is how you have to do it in C
I need to not use volatile C loads and stores

I mean I already have it abstracted to functions
So it’s like a very fast fix
volatile loads/stores would maybe be ok if not for the fact that theres a brief range of amd processors that require it to be using the A register for some fuckin reason
Yup
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")```
And it has to be mov
is this because of xhci
for MMIO_WRITE8
yes
did you know you can just check in qemu is compiler doing some shit
asm volatile ("movb %1, (%0)" :: "r"(address), "{al}"(value) : "memory")
This is how inline ASM works
Idk if GCC supports that syntax yet?
wow thanks how fucking useful
idk i use zig so im in clang land lmao
(respondign to the code snippet from evalyn)
Sorry
its fine
that syntax is literally what im using
clang doesn't like it
For legacy constraints
isnt capital A for the weird eax:ecx thing?
asm volatile ("movb %%al, (%0)"\
::"r"(address),"A"((uint8_t)value)\
:"memory")```
this worked
cool
ill check with godbolt
Yeah it’s lowercase
Maybe?
yeah lowercase
capital A is for the eax:edx combo thingies but only on x86_32, it doesnt work on x86_64 ime
MMIO_WRITE8(0x1000, 0);```
becomes this
```x86asm
mov edx, 4096
mov eax, 0
movb %al, (edx)```
which looks about right
yeah that looks right
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
virgins use some mmio_write when real chads use volatile
gcc people back int he day™
says the guy whose tag says sponsored by the brand that makes that not work
And only on checks notes bulldozer Microarchitecture CPUs for some fucking reason
Intel allows crazy shit on MMIO too
the newest bios and kernel developers guide from amd still lists the requirement so they could add it back at any time lmao
You can xor a register apparently and crap if you wanted
# 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
yep
Can you get me the latest docs lmao
Somebody dosnt wana support this
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
i googled amd ppr and got this document from 2025 from them
What does configuration in this scenario mean?
ECAM
yep
fsdfsdpoi MMIO_WRITE32 doesn't compile
currently my kernel doesnt have generic mmio helpers, only ecam ones
# 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
youre still clobbering eax
at the end
Your doing the eax thing there
this is the bottom of the page right before that
https://docs.amd.com/v/u/en-US/57930-A0-PUB_3.00 oh and heres the fuckin docs im looking at i should share that
and pci if youve got that, pci needs this sort of setup too
no PCIe on obos yet
ah you still only using the io ports? in that case yeah not yet
Why aren’t you using pice for xhci??
do u even have pci
im waiting for iso day 1919
giopsfdjs
because some hw can forgive something other not
i really dont understand this ngl
obos doesn't even boot on 99% of hardware
if it has a haswell cpu then it might
haswell is 2013 era
cpu
i have laptop with celeron from 2012-2014 is it will run
maybe
linux ignores this "problem" entirely btw
ill send iso
im not linux tho are i
then why do you need to care
because dumb cuck amd says i do
And linux could very well have issues on certain weird ass hardware configs due to this problem technically
yet nobody is complaining so this seems like huge larp
and complexity that nobody cares about
fix ur kernel before doing xhci 🥀
I mean it’s still better than doing mmio->register and crap which is what OBOS does rn
Can’t that generate certain memory accesses not proper for registers?
Even if volatile
structs are more comfort than mmio_write() stuff
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
volatile has some issues yes
but yes being able to read an entire struct with mmio at a time is kinda nice
i probably dont need to distrust volatile so much i just kinda do lmao
gcc has some details
yeah reading whole structs is def a point in favor of using mmio pointers
Volatiles (Using the GNU Compiler Collection (GCC))
rip
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
what's the problem
is dw0 volatile?
i forgor
bro
bro...
bro
i think it's time to go
im on the pro-mmio-helpers side and i cant defend that lmao
how do you post 20 mb file without nitro
ig server boost
@flint idol did volatile dw0 fix the codegen
lmao
wait can i send u an iso
with more logs enabled
on my main pc it hangs there
obos never booted on amd
never figured out why
probably never will, i dont own amd hardware
unless of course, patches sent
what pte bits do you use for software purposes
52 and 9
theres a bit in the pte thats ignored on intel and reserved-must-be-0 on amd thats actually checked for
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)
can u use the iso i sent above
it has debug logs
ok thats probably not it then, bit 8 is the one that got me
(page directories and up arent allowed to have the global bit set on amd)
ic
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
i see
well i dont use it at all
as of today
(i might soon for optimization but idk)
so that isnt why obos dies on amd then lol
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
on my old laptop with celeron it just triple faults
oh well
that's sad
ill put it on my list of known broken hardware
(it is now 54983 entries long)
i remember times when obos had proper suspend and resume
obos prime is end

i need to fix my suspend and resume 
i should do suspend/resume someday
did you ever write that osdev article
no
no u shouldn't its acpi insanity
pump thoes numbers up
the first four were all in 2023/2024
ive had one atm
c -> rust -> c (zinnia)
also theoretically my acpi suspend code is correct
for those who want to look at it for reference
neat
its that something regressed somewhere else that causes suspend not to work properly
also tested on some real hardware and it worked
just the framebuffer does die on S3 suspend
on most hardware
cuz the gpu goes to sleep
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)
stars on the thread?
dew it 
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
okay mark my words I will do this sometime in the next few days
Sunday at the latest
I'll hold you to that >:3
someone pin this
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
due to foreseen circumstances, I will have to delay fixing real hardware bugs by a few days
(I installed bmc4)
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
It would have been believable if not for the last two lines
@dense vigil
Why aarch64
right
okay
the rewrite will also not support x86
and will not support any cisc arch
Will you do ppc32be
maybe
that's the second port i will do
i will start the rewrite in a few hours, godspeed
it is my great pleasure to announce that i have smashed all my iphones
therefore i can't run your OS on any of them
oops! 😊
bruh
6th rewrite incoming
havent beat bmc4
but
tmpfs dev has been happening in the meantime
and this lol
VNODE_TYPE_CHR 
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
?????

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
well that dont look right
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


Who needs thoes anyways
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
no
it ||is just a test of tcp keepalive that i wrote and forgot about||
i committed tmpfs
Btw
yea
oh 
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
i added some code to make it check if the file exists before returning the dirent
in the dirent lookup code
which fixes this crash
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
i could just nuke the entry then repopulate it from scratch
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
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
this indeed works
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
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
yeah that sort of thing fucks up the entire flow
my poor PFC getting interrupted
(prefrontal cortex)
actually brain is very interesting
probably might study that thing after high school but who knows
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
bruh
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
🎉
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
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
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
each time it returned OBOS_STATUS_NOT_FOUND
why does exit current process have 4 damn arguments
it doesn't
the syscall logger is too lazy to know what arguments actually exist
so it prints all 5 registers
lol
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???
obos stability strikes again
lmao
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
as fflush does not set errno iirc
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
i think i fixed pipes finally
cuz i got groff to work
i spoke too soon
nroff works but noooo man-db doesn't
syscalls have 5 parameters yes
i'm out here with 9 parameters max
damn
(though on i386 i have to work around the lack of gprs so i end up doing some extra stuff)
I just overflow to stack
has that ever been proven useful
i do have to do that with i386
if i need more than 5 arguments i just have the last one a pointer to a struct with the extras
I use uint64_t for everything, so all of my syscalls are super long on ia32
i have a function that takes 7/8 arguments
But I also have syscalls that take like 10 uint64_t's
(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);
Nevermind, it's 8 parameters
But I just pass a struct to kernel because it's too much
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
So 64 bytes
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);
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
What's a universe
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
currently always kHelAbiSystemV (1) :^)
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
I see
Ah
So its more like personality
i guess, but nothing's been decided yet
Fair
in essence, handles in and of themselves don't mean anything, but (universe, handle) references some specific kernel object
for most syscalls it's implied that it uses the thread's universe
and there are syscalls to manipulate an universe by handle to it
can obos survive a fork bomb
what else would it do lol
technically it doesn't hang
but it is rendered inoperable
as there is nothing u can do to kill the fork bomb
libpipeline is so stupid i hate libpipeline
does the kernel itself deadlock or is it just rendered inoperable cuz of all the processes
I'm not sure
Does it not oom
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
mandoc ❤️
atp i might as well port mandoc instead
todo fix more bugs today
i don't use ai for obos at all
but i'm keeping it here because i can't be damned to move it
mood
tbh if i didnt want to reorganize my top post and add a pinboard message i wouldnt have bothered for mine either
i'm gonna look for a reprod on linux mlibc
as expected, this does not happen on linux mlibc
i thought obos was like vibos
vibes 
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)
OBOS (not vibecoded)
maybe debugging today?
xhci
PowerPC port 
zig rewrite
rust rewrite
c++ rewrite 
c rewrite
ada rewrite
v rewrite
lol
debugging.
Rust rewrite day
lmao
F
porting systemd day
Taking a break and not overworking yourself day?
whne c rewrite
when hoi4 port
Jai when
no more like overworked by school and not feeling up to debugging mandoc
when there is much easier forms of dopamine to be found
the nice thing with hobby projects is theres no deadline lol
real lol
for example the dopamine of finding a new project to work on that u know u don't have the motivation to exactly start but definitely to explore
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
what did u buy
intel 8086
new project*
the actual thing is $5 dsfsdfds
(for reference i can ship in two ICs from china for $8)
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
I have designed a few computers but never built one
with 8086?
itd be nice to do it but it's easily like 200$
8088
ic
I've also done 6502 and partially 65816
i wish zig had 6502 support tbh. (or actually 65c816 tbh), id design up a machine for that happily to play with
m68k
(/j)
llvm has one
ill probably start the design of the 8088 thing rn
not officially part of llvm proper so i cant use it with zig really
(side note that someone managed to snipe issue #6502 for the git issue tracking 6502 support for zig and i find that hilarious)
depends on what you want to do
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
very topical, i just ordered a pcbs from jlcpcb for my 65816 project :^)
i just need a side project that will keep occupied for a while even if im not actively doing it
yeah the pcb is just a 40 pin header to dip adapter
plus passives
to be specific, it's an actual 65816, with the fpga being the rest of the owl
yeah i don't see a reason why this wouldn't be possible with other cpus
there were commercial PC chips even
idr the name
faraday
What did you want to do with it?
Like eat it, destroy it, port obos to it or
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
eat it
prob just write some code to drive it
You can run a 286 on a breadboard so...
I think there's even been a 3 or 486 project maybe?
you need a breakout board
which is not cheap nor readily available
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 🙄
isn't this the standard tho?
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
well, flash memory ICs have them active low too
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
active high is not standard
this
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
i don't think you should use eeprom as write mem on your pc
but use a flash instead
i see, any particular reason?
eeprom doesn't like being re-writted that often
it will prob die quite fast compared to flash
okay
could maybe wire it up through some gate and some ff to allow enabling writing
WE# = or(WR#, ~enable FF)
then have the FF be writable through a bit on some io port or w/e
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
are you gonna use any programmable logic or just generic logic chips
just generic logic chips
ah
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
and then there is some more logic in the ram because i am using two 32K RAM chips to address 64K of ram
nah
just some logic to choose either the first or second chip based off A15
this is what i came up with on paper
for the ram decoding thing
not the prettiest sketch
but i've drawn worse
most important is can you read it lol
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
nvm
i did put it in the schematic
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 
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
You can also use an arduino or pi pico
If it’s a DIP chip and a parallel flash rom
It’s really easy ish
that's what i'm gonna do
i just wrote a flash programmer for the ROM i'm gonna use





