#Astral
1 messages · Page 10 of 1
i want to implement procfs but a) idk how procfs works in general b) idk what those functions are supposed to do
its for writing pages to/from the page cache
while b) is a problem a) is probably a bigger one 
okay so i can just ENOSYS them or something?
or just return 0?
i dont think these are needed for procfs
all regular file I/O goes through it so uh
with content being generated on the fly
oh
well those aren't regular files
__assert(!"tmpfs_read is handled by the page cache");
hmm
I guess I could make pagecache support FS specific and have regular files for non supporting filesystems go through the normal route
hmm
lemme see
I could add a helper function in the vfs or vmmcache or whatever that says if the page cache would be available for a specific vnode and add those checks everywhere
like in vfs_read/write or in vmm_pagefault etc
not sure what the right choice would be 😅
i tried running startwm as user 🤔
works as root, hmm
weird, it should work as both
hell yeah
works on my machine
maybe it was just a bit slow
yep lol
it's really bad and i wasn't in the mood to fix that, but i was in the mood to have the build run flawlessly on aarch64, so i nuked it
I wonder if how I did it would make any difference
@robust geyser should be ok now
it'll go through the page cache if its either a block device or a regular file AND it exposes the VOP_GETPAGE and VOP_PUTPAGE vnode ops
so just have VOP_GETPAGE and VOP_PUTPAGE = NULL and you should be fine
also @prime juniper mr portmaster what do you think of the shit I pulled here
it's nasty sure
but have you seen this
(it's yaml but over the discord character limit)
what the fuck
or this
yeah I have some nasty shit
but chromium is a real piece of work
firefox is a bit better on the eyes recipe wise
5head build system
NSS is fucking nasty
contain *SS
openssl is also stupid as fuck
webkitgtk by a metric shitload of advantage
chromium compiled and ran a webpage once upon a time
might actually work now
but it bitrotted and doesn't build
the cross compilation process took me a full month of hard work (make a patch and watch it compile for 343943 hours, repeat until done and better not touch any gn files)
firefox didn't compile fully and I never debugged that
links beats webkit but that's text mode only
and I'm assuming proper browsers here
yeah links isnt really good
I need to get around to seeing how one ports webkitgtk to a new platform
oh it's fine
links in gui mode will even load pictures
I can and have read news on it
inside Managarm
true
webkitgtk probably depends on gtk, so get that first
well
yes
but
it's webkit
and the gtk port is webkitgtk
soooo
maybe there's a better port for you out there
or you write your own completely
GTK3 will do X for you
(half of linux gui apps use it)
managarm only keeps it around for gtklife (broken anyway) and hexchat
where hexchat is due to be replaced by konversation (Qt based)
make it happen
it'll only support wayland?
unsure
webkit/wpe is apparently a thing
but wouldn't be surprised
wpe webkit
its an official webkit thing too, from what i can read
and will use wpe if available and told to do so (which is recommended by BLFS)
yes
I need my pretty xscreensaver demos grrrrr
but I agree we need it
xclock needs to go brrrrrrrrrr
webkit wpe seems to want libwpe, which on arch depends on not much (namely libegl and libxkbcommon)
xedit also needs it I think
libwpe isn't bad no
might be a good choice if you want to avoid gtk/qt then
which i dont think you shouldl
- name: libwpe
metadata:
summary: Platform-agnostic interfaces for WPE WebKit
description: The libwpe package contains a general purpose library for WPE WebKit and the WPE Renderer.
spdx: 'BSD-2-Clause'
website: 'https://wpewebkit.org/'
maintainer: "Dennis Bonke <[email protected]>"
categories: ['gui-libs']
source:
subdir: 'ports'
git: 'https://github.com/WebPlatformForEmbedded/libwpe.git'
tag: '1.14.1'
version: '1.14.1'
tools_required:
- system-gcc
- host-pkg-config
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
pkgs_required:
- mlibc
- mesa
- libxkbcommon
revision: 1
configure:
- args:
- 'meson'
- 'setup'
- '--cross-file'
- '@SOURCE_ROOT@/scripts/meson-@OPTION:[email protected]'
- '--prefix=/usr'
- '--libdir=lib'
- '--buildtype=debugoptimized'
- '-Denable-xkb=true'
- '-Dbuild-docs=false'
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
enjoy
you also want this
- name: wpebackend-fdo
architecture: '@OPTION:arch@'
metadata:
summary: WPE backend designed for Linux desktop systems
description: The wpebackend-fdo package contains the Freedesktop.org backend for WPE WebKit and the WPE renderer.
spdx: 'BSD-2-Clause'
website: 'https://wpewebkit.org/'
maintainer: "Dennis Bonke <[email protected]>"
categories: ['gui-libs']
source:
subdir: 'ports'
git: 'https://github.com/Igalia/WPEBackend-fdo.git'
tag: '1.14.2'
version: '1.14.2'
tools_required:
- system-gcc
- host-pkg-config
- virtual: pkgconfig-for-target
triple: "@OPTION:arch-triple@"
- wayland-scanner
pkgs_required:
- mlibc
- libwpe
- wayland-protocols
- wayland
- libepoxy
- glib
revision: 1
configure:
- args:
- 'meson'
- 'setup'
- '--cross-file'
- '@SOURCE_ROOT@/scripts/meson-@OPTION:[email protected]'
- '--prefix=/usr'
- '--libdir=lib'
- '--buildtype=debugoptimized'
- '-Dbuild_docs=false'
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
idr if I upstreamed these two
wayland
lol
:(
yes wayland
oh BLFS webkitgtk no longer mentions wpe
does have an optional wayland dep tho
what
hard dep on libgudev?
gentoo disagrees
day 12031283219321 of telling myself to implement auth checking for kill()
i should do the astral vm thing i wanted to do
yeah yeah
i would just
have it print some byte sequence over e9
and the host would listen for that
and restart if needed
i would print that on panic
true
i could log everything to a separate file
each "session"
and if it panics i would save that file for analysis or something
since i would use qmp to interact with the vm i could even backtrace on panic
im just not too sure how to make spinning up multiple vms without anyone being able to fill up the disk space
i guess the root image would be small, each vm gets like 128M and thats the only storage they get
hmm
managarm can do that too if I fix ssh and get someone to give the netstack some server love
I'll keep that in mind for later
:D
does managarm have fd passing in unix sockets
I'm 99.9% sure we do
openssh needs that
you mean SCM_RIGHTS right?
SCM_RIGHTS
Send or receive a set of open file descriptors from another process. The data portion contains an integer array of the file descriptors.
Commonly, this operation is referred to as "passing a file descriptor" to another process. However, more accurately, what is being passed is a reference to an open file description (see open(2)),
and in the receiving process it is likely that a different file descriptor number will be used. Semantically, this operation is equivalent to duplicating (dup(2)) a file descriptor into the file
descriptor table of another process.
this shit?
yeah
if(!packet->files.empty()) {
if(ctrl.message(SOL_SOCKET, SCM_RIGHTS, sizeof(int) * packet->files.size())) {
for(auto &file : packet->files)
ctrl.write<int>(process->fileContext()->attachFile(std::move(file),
flags & MSG_CMSG_CLOEXEC));
}else{
throw std::runtime_error("posix: CMSG truncation is not implemented");
}
packet->files.clear();
}
yep
based
recvMsg will handle that in unix sockets
then you should have everything once netserver
welllll
if I do ssh dennis@<my server ip> I get some weird port parsing memes
sooo
I'll pull the error
so it might not be in mlibc
yeah mlibc is unlikely
oh even worse
unexpected setsockopt call
whoops
then this becomes an issue for later today
I wanna finish my bootstrap PR and go to sleep
wait
layer 0 number 1
ssh from managarm into astral and vice versa soon
number 1 is SO_DEBUG?
the fuck?
layer 0 is AF_UNSPEC?
the fuck?
ah it's also SOL_SOCKET
hmm
I'll debug this later
yes
that would be based as fuck
the Managarm side just needs to not forget to run dhcpcd first (and I did just forget that so I got ENETUNREACH whoops)
im gonna set up a thing to spin up astral vms in a bit
i should be able to spin up ~50 vms at any given time, memory wise
if i give each vm 128MB of memory
idk how well the cpu will handle that but 
wtf
I mean
128 mb of memory should be more than enough for bash and stuff
iirc it boots into fvwm with that
i see, i might experiment a bit and give it less even
cries in Managarm footprint
"""micro""" kernel
how much does managarm need
should i just expose a shell over a web interface?
idk how it should work lol
astral shell as a service™️
except its not a service because its free, whatever
how would that even like work
iirc the lowest i tried and succeeded to get into weston was 700M
or thereabout
but that was a while ago
idk, you visit a web page and get an astral shell 
or you just ssh into something and that spins up an astral vm
websocket terminal on the client and a server that just bridges an ssh client to that
yeah, basically what i wanted to do
westom moment
wb kmscon?
i think back when i tried we didn't have kmscon yet
hmmmm there are some vps providers that do something kind of like that
but now that i think about it i could just create a simple ssh server that spins up a vm and then proxies to astral
hm i wonder if copy.sh/v86 gained x86_64 support
prob not
Some features are missing, in particular:
Task gates, far calls in protected mode
Some 16 bit protected mode features
Single stepping (trap flag, debug registers)
Some exceptions, especially floating point and SSE
Multicore
64-bit extensions
yeah i just went to the repo
just checked and it seems 482MB or so?, oom at 480MB
hmmmmm
481MB ooms after kmscon is launched but before bash is launched
i guess it might vary a bit from run to run due to scheduling differences
but i guess 512 ± 32MB
i still wonder what takes up the most memory
I mean managarm has a lot of stuff running
i still don't think that should add up to 512M
on the posix side it's 12 processes (incl the ls /proc process ig)
oh LORD
damn
do you know the usage for each?
the bare minimum for astral right now is 30 mb to drop into a bash shell
nothing else works
no, we don't do that much accounting in the posix server so /proc/<pid>/status just reports N/A for the mem stats
also servers (so drivers, posix-subsystem itself, etc) don't count as posix processes
I mean would the servers even use that much memory?
they shouldn't, most of them don't do anything, and after init-stage1 stuff's launched via udev rules
and init-stage1 only launches servers potentially needed to mount the rootfs
so all the various block device drivers, usb controller drivers, and the usb storage driver
hmmm
I guess you could maybe do some sort of accounting to figure it out if it becomes too big of an issue
yeah
honestly i dont think so
i kinda just want to see astral self host :^)
i mean i know you can build yourself
but not all the tools (yet)
and jinx is also a bit of a problem
but mint mentioned something something containerless mode
so you might be able to make it work? ™️
hmm I could work on fat next thing
yeah gcc build is still funky
I should bump mlibc again and see if I can still not build gcc
or try with different cflags
As in, userspace programs? Most of the big ticket items are already covered. I guess I never ported a webserver so try apache2?
Exactly
here we go again
oh i was gonna download it on astral
l mao cpp size_t VirtualOperations::getRss() { // Derived classes should track RSS; the generic implementaton does not. // TODO: As soon as all derived classes implement this, we should make it pure virtual. return 0; } (ofc no derived class implements getRss)
youd need to patch and rerun the autotools which I dont have
TODO: do everything
I guess
@prime juniper were the perl issues on managarm mlibc related or managarm related
ok we building
damn it is slow
actually, idk, i would have to compare it to linux
also building here
inb4 it works for you 
it segfaults like a few hours into the build
due to mlibc rbtree memes
Unknown
It’s just dogshit
Happens on managarm too during configure of some programs
Yikes
what exactly happens
It complains about some scalar refs bullshit while use strict is set
Lemme pull the error for you
re the perl issue
Can't use string ("Getopt::Long::VERSION") as a SCALAR ref while "strict refs" in use at /usr/lib/perl5/5.30.2/vars.pm line 35
The string doesn’t really matter, CPAN gives the same error on a different string
But it’s always scalar ref while strict refs is in use
And this is shipped Perl code , not some third party bs
Outside of this, probably some module finding meme from what I remember of autotools
hmmmm
Idr the error for autotools. But this scalar thing is pure kanker
crazy that python works just fine but perl doesnt
confirmed that python>perl :^)
Still building
I will leave it building overnight and hopefully coming back to it working pls
same here
@wild marsh https://github.com/osdev0/libstdcxx-headers
now we got proper freestanding C++ headers
rip
now sdl audio works (kinda) except that it has a huge latency for some reason lol
one problem that should be done something about is that the oss header file is installed into /usr/lib/oss/include/sys/soundcard.h instead of /usr/include/sys/soundcard.h, it looks like on a glibc linux system glibc comes with that file so ig that might be why the oss package doesn't put it to /usr/include/sys/soundcard.h
Holy shit it actually works?????
Thats amazing tbh I was expecting it to just segfault and die like it did before
But I think that was just some missing stuff in mlibc?
Also what do you think could be causing the delay?
Yeah thats where it "should" die
And yeah Ill change that I think it is using the linux install script in it so
Unless you already did
yeah no I didn't
I think its somehow related to the buffering/queueing of the audio, I changed the buffer size to be bigger and it sometimes is fine but then others it isn't (and also plays the same effect multiple times)
yeah I don't think unless a thread can not get scheduled in a period longer than 100ms or something like that (though idk if 100ms is a too large buffer time, it might be for time sensitive stuff like games)
My quantum is 100 ms that could be an issue lmao
Idfk why I set it that big
Change it in scheduler.c to 10 ms or something and see if that helps
Actually it shouldnt be an issue if the thread blocks?
Idfk
yeah looks like that didn't fix it, ig its unlikely that any of those threads run for 100ms without blocking anyway
Hmmmm
Ig you can enable e9 logging and just add some arch_e9_puts("doing foo"); around
Also did the oss utils build and work
they did build file and I assume at least ossplay should work (though iirc it uses some of the weird ioctls like setsong that I didn't yet handle in any way)
that ioctl doesn't even do anything other than sets the song name that you can then retrieve with an other ioctl lol
Bruh lmao why is that even a thing
yeah idk
ig you could like have some other program display the currently playing song name somewhere? but idk if anything actually does that
True
well my first thought is when you have your session locked while having some media playing in the background. you can have a widget on the unlock screen with the name of the media and a play/pause button
you know, something like that on android
just get the stream name and executable from the audio bus and interface with OSS/ALSA/pulse/pipewire to manage it
its really common
if you want an example in linux, check gnome or cinnamon
yeah ig there are actually uses for the name when its used without a separate sound server
also music production is extremely time sensitive
well on desktop linux this is done via mpris over dbus
mpris, not to be confused with the late empress of the raj, victoria
I left gcc building with CFLAGS="-O0" CFLAGS_FOR_TARGET="-O0" to see if thatd make a difference
When Im home Ill find out
didn't change anything sadly
init now does what I wanted it to do
waits for poweroff/reboot command,
sends sigterm to all, waits 5 seconds OR until everyone has died
sends sigkill to all, waits until everyone has died
syncs disk
shutsdown
I do need to deal with this console stuff keeping the input
there we go
I moved startwm into /usr/libexec/astral/startwm
and made an alias that only appears if running on /dev/console
damn, very mice
how did you fix bash not wanting to die immediately? just curious
i don’t imagine it was hard but im still curious what the problem was 😅
startwm now execs the script
as per the alias
bash ignores sigterm
so I just worked around that
When bash is interactive, in the absence of any traps, it ignores SIGTERM (so that kill 0 does not kill an interactive shell), and SIGINT is caught and handled (so that the wait builtin is interruptible). In all cases, bash ignores SIGQUIT. If job control is in effect, bash ignores SIGTTIN, SIGTTOU, and SIGTSTP. ```
interesting
either way
I implemented permission checking for kill()
so I think that is all for multiple users
but as a regular user?
ohhh
idk which one you use
unbased
gone are the days
wait holy shit
if qwinci's hda driver works on real hardware
really smooth quake gameplay soon with audio????
imagine if you could boot it off usb…
It could probably hit a thousand fps with a proper igpu driver
need to get my shi together 
Same
Lol
(im cooked)
To be fair porting uacpi is a few hours and implementing xhci well is like half a year probably
Xhci and the entire USB stack I mean
probably easier to just install to disk by writing enough nic drivers and downloading the root filesystem
i did it in less than a week in my kernel lol
Well I said well 
I have Realtek 8169 GbE if you're interested in doing a driver for that
I also have a few E1000 (and variants) PCs
Well means it works on 99% of real hw and does hubs and stuff
Plus hid and mass storage
If u actually tryhard it full-time maybe you could pull it off in a few months
i did hid boot protocol only tbh
and i did mass storage
Well yeah lol that's what I mean
Did u support hubs?
Thats where all the pain in the ass comes into play as well
Idk managarm still doesn't work with hubs
So I imagine its pretty hard
I mean if it'd help test on real hardware it'd be nice
yup, that's the idea lol
i am pretty sure managarm usb does hubs? idr tho
But yeah like if u sorta hack stuff together in a reliable way that might work much faster
i think i saw some code
Does yes, do they work tho? No 
I can say that about so many things with my projects its honestly kinda sad
does code for it exist? yes
does it compile? maybe
does it work when you run it? no
I saw some of the qookies attempts at debugging xhci and it kinda sucked
Like its pretty hard
But maybe im wrong
I think debugging USB is just hard in general
I need to do it on the Wii.... and man does it suck
Ohh
never would I wish this message on my greatest enemy
[ 3.805877] ehci-hlwd d040000.usb: fatal error
[ 3.807342] ehci-hlwd d040000.usb: HC died; cleaning up
I mean look
This driver works on other wiis
Right
Its probably a hardware problem
not with my janky kernel, lol
the issue is when I port the driver to a newer kernel revision
4.20 (nice) vs 4.5
69 is when u say nice
close enough
Anyway it works on a newer kernel?
no, the opposite
Just bisect the bug then, that should be easy
the driver is written for 2.6, ported to 3.15, ported to 4.4, ported to 4.5
works in 4.5, doesn't work in 4.20
git bisect
Find the commit that caused the regression
Why is 4.5 the latest one u tried?
Wonder what I should work on now
Oh sorry for stealing your thread again
it's not, but let's move this to #lounge-0 or smth, this is the astral thread
lol
Lmao its fine
same idea at the same time
Hmm
Well u could unfuck ps2
Make it more stable on real hw
Add support for synaptics touchpad and multiplexed ps2 if ur interested as well
Both relatively easy drivers
I wouldn't have any hardware to test that on tho
both my machines ps2 works for some god unknown reason while everywhere else it just
doesnt
I could look at other implementations and see what I do differently
Well you could at least look how Linux does it and see what ur doing wrong and what you're not handling at all etc
Yeah
Or freebsd or anything else
🎉 nice
bruh
bruh
bruh
bruh
bruh
wait nvm
actually
bruh
wait no
aaaa
idk
I might just throw this all out and rewrite it
I've been having some weird brain fog these past few weeks and its not helping
looking at what ultralegacy does it might be from my timeouts being too restrictive to me not properly sanitizing the input
yeah I understand the fine print now
holy shit the ps2 code seems to have worked first try on qemu lmao
yeah right :^)
time to see if this will work on the real deal
Expected (no ps2 mouse)
Funnily enough it asks for a resend but there is nothing there
And I forgot to add a check ooopsie
For too many resends
Obligatory acpi for infy
what is that stuff printed to the console lol
I think it tried to print the bash pront to the console and also the init message
I do wonder WHY THE FUCK does uefi give limine a 800x600 framebuffer
I am using an 1080p screen
Doom does work on my desktop tho
Which is nest
Neat
what more could you need
that reminds me that sdl is borked on mammogram so no dsda-doom for me there
And x does seem to work too
Just no mouse
Cuz I dont have one
And the fact its 800x600 grrr
Wait what
dsda-doom thinks a window is open but it literally isn't and i can't do anything
i also need to update the port since it's at like v22.5 and the current version is v28.1
Maybe its fixed in a new version
i think it's an sdl issue
iirc tyr-quake also has problems with getting a window open
it used to all work
oh weird
tyr-quake works fine on astral
what version of sdl and tyrquake do you use
the tyrqauek I'm at is 0.71 and sdl is 2.30.2
sdl 2.28.4 and tyr-quake 0.65
hmm sdl doesn't even compile :^)
/var/lib/managarm-buildenv/build/tools/system-gcc/lib/gcc/x86_64-managarm/13.2.0/../../../../x86_64-managarm/bin/ld: CMakeFiles/SDL2.dir/src/video/wayland/SDL_waylanddatamanager.c.o: in function `wl_data_source_destroy':
/var/lib/managarm-buildenv/build/pkg-builds/sdl2/wayland-generated-protocols/wayland-client-protocol.h:2353: undefined reference to `wl_proxy_marshal_flags'
damn
laptop test time
And it works on my laptop + acpi for infy to be happy
Im gonna send an iso here and uh
@fleet osprey you had a bunch of ones that the ps2 didnt work right
I did some changes to the driver can you test them again thx
Im gonna be putting enough in the iso to run X and some fun packages
@sacred gyro
it has these packages
MINIMALPACKAGES=mlibc bash coreutils init distro-files vim nano mount netd shadow sudo neofetch ace-of-penguins xterm fvwm xorg-server xclock xeyes doomgeneric doomgeneric-x11 xneko xf86-input-keyboard xf86-input-mouse xf86-video-fbdev xfontalias xfontmiscmisc xfontmiscethipic
yeah, will get it soon
parents are being annoying, won't have a chance to check it for a decent bit
Damn
perhaps if i actually had sdl 2.28.4 sources and not 2.0.14 it'd work better
have you tried forcing it manually?
fixed it with the kmsdrm video driver, the x11 driver seems to freeze weston? https://uwu.foundation/3W5iHux.png
the kmsdrm driver has broken logic in it's init function too which was fun
it says that if something fails it's fine but it ends up returning -1 anyway
okay yeah SDL_VIDEODRIVER=x11 seems to make weston freeze, and SDL_VIDEODRIVER=wayland leads to egl failing to initialize
ok checking the new PS/2 code now
PS/2 Keyboard does NOT work on my ThinkPad T14 Gen 1 AMD, probably no mouse either (but I can't start xorg to test)
power button works w/ ACPI poweroff tho 👍
On the Precision T1650, no keyboard emulation support in UEFI, and I can't get it to boot in BIOS (firmware just yells at me, Rufus probably doesn't like me for some reason or another)
And sadly no access to a real PS2 kbd to test the real PS2 ports, nor a low power enough keyboard to use the USB adapter
ACPI shutdown works there too
aand the Optiplex 755 just hangs trying to boot it
I hit enter on the USB Device option in the boot menu, and then nothing visible occurs
remains on the same VGA text mode boot screen into infinity
probably a side effect of trying to flash the ISO to a USB stick
but I really don't want to go dig out a whole ass optical drive and some CD-Rs just for this
and regardless, I am out of time to for today
if you want to provide a BIOS-bootable USB image, I can try it out on there, which'll be interesting
this thing has a known bugged PS2 emulation mode
something like every other key, it'll just eat the IRQ for the keypress
it'll go into the buffer, but not actually fire an IRQ
so the next time you press a key, it'll fire an IRQ, but have 2 keys in the buffer (at least, that's my understanding of it)
DOS and early Win9x actually choke hard on this, on the next IRQ after the bug occurs, it'll only readthe initial (bugged) input, so your inputs are now permanently 1 keypress behind
and it just keeps adding onto itself, e.g. if it triggers again, the OS is now permanently 2 keypresses in the past, etc
so I really do wish I could get Astral running on here, really interested to see how it handles that
@fleet osprey if you could keep in mind the machines one which it did not boot...
but didn't we go through this together already?
nice
im very happy with uacpi success rate at this point
are u saying your ps2 code is based on uPS2 
I should
Aaaaaaaa
Did any error messages appear
Yes, and Yes
the issue being the way that the image is made, it just can't work, iirc from before
I would either need to:
A - boot from Ventoy, which breaks the image
B- use a "real" HDD/USB image, not an ISO
nope, not on either machine, they both got to a root shell, but PS/2 emulation did not seem to work
I took some ideas™️
Wtf so it passed everything and still didnt work
The machines I have use real ps2
Maybe I should try checking how my desktop does with emulation
Emulation works on my machine
Bro even ps2 mouse emulation works
The mathewnd curse I guess
I should also test astral on my laptop, I know that with my own os ps2 sometimes doesn't properly work on it
it just doesn't respond to self test (or at least not in the order that I expect that is first the ack and then the result, idk maybe it does it in the order order or whatever I haven't really verified)
Thatd be neat I really need to get to know whats wrong to get ps2 fixed
If you need to fix a driver you're writing, then looking to ultralegacy always helpa
*helps
I really need to test it on my optiplex at some point
if that works, I would be very confused
since it must only work with buggy PS2 implementations
lol
I mean it worked with two real controllers already
Idfk what could be wrong since in every possible case itworks on my machine
Even ps2 mouse emulation which Ive heard is almost never right worked
I really am out of ideas
Maybe the initialisation is fine (you said nothing errors out) but the actual interrupt or scanning stuff is bad?
I'm mainly interested in getting it to work on my optiplex so I can compare against my own impl from an old version of TechflashOS, that I know for a fact worked on this exact machine
no idea if it works on anything else since I haven't touched TFOS in years
Lol
@robust geyser if you have any machines you can try on can you try astral on real hw and see if ps2 works
I hear you need people to test out PS/2
I’ll test it on my Chromebook
Which iso am I using?
Has a really basic x installation
@sacred gyro
It edited tge message for some reason
Instead of replying
Ok, will test in a bit
ok, so the keyboard didn't want to work....
but the power button, which is on the keyboard, did...
isnt chromebook keyboard spi or something
depends on the model
yeah
some of them do have PS/2 because the PS/2 on my OS magically worked on one of my chromebooks
looks like some new ones are i2c
Thats routed differently so thats expected
The power button goes through acpi and not ps2 or spi or whatever
ye
Going insane why is it only on my machines that it works
Did any error happen?
Yeah that's the most default ps2 keyboard
so theoretically it should work then?
Yes
Ps 2 self test timeout
Says right there
must've somehow missed it the first time
I don't even think my driver tried to self-test
it just blindly assumed that "yeah it totally exists"
I forget if I even throw any init stuff at it
just blindly assume it's already set up and on IRQ 1
but that may be wrong, I wrote it a very long time ago
....
yeah so my initialization routine was (when it still existed) a bit more simple than yours
but weirdly, it works on my hardware where Astral doesn't
so then, it would seem to be actually the opposite of this?
ps2 is fucked
some machines require init to work properly
some machines work only if you don't init
why do you guys keep talking about ps2, the ps5 launched like 2 years ago already..
who's gonna buy me a ps4 so i can port mammogram to it :^)
I wonder how Linux does it then
I know for a fact it works on this ThinkPad where Astral doesn't (I'm typing this message on it rn)
I haven't tested it w/o USB (so it forces PS2 emulation) on the Optiplex 755 or Precision T1650 though
put it on the company's credit card
"business expenses: ps4"
if you go to austria id happily sell you my ps4 i dont use lol
Thats the ps2 mouse not being found which is probably right
I do wonder why the keyboard doesnt work
Yeah, the touchpad in here is i2c
I really can't get the sdl audio properly synchronized 💀 I even switched it to use double buffering so the queue function puts data into a ring buffer that the irq handler then takes data from if there is data and if there isn't then it just increments the position so it keeps up with the hardware (and ideally it should also memset it to zero so some random data isn't being played again but that's not relevant for this)
Does it take too long to run the irq or is it just hda memes?
I don't think it should take that long because it just locks a spinlock and then checks the ring buffer + potentially reads a page from there and wakes up a semaphore (though ideally it would be an oneshot event that can't be triggered multiple times but eh)
and there are like 46 irqs per second
(for 48000hz 2channel 16bit)
if it would take too long for it to run the irq after it has consumed one page of data then it would also break catting a wav file into the device file
it generates an irq after it has played whatever buffer period worth of data you specify
Hmmmm if catting isnt broken then it could just be an issue with sdl
Does sdl write proper data into it or does it take too long
well I do have one thing that I could try, I could try using whatever sdl specifies as the fragment size (which is basically how much data you can queue without blocking) instead of hardcoded page size
maybe sdl calculates its internal timing based on that or smth
Fragment size?
its the audio buffer size as far as I understand and there is an oss ioctl to set that (so then you can write that much data before it has finished playing the old data without blocking)
afaik a 64-128ms buffer is the norm to avoid noises
46 irqs per second means 20ms
hmm so it would be like 10k-24k bytes (with 48000hz 2ch 16bit)
anyway Ill try to see what sdl actually wants to set it as
Yeah maybe sdl just wants it set up in a specific way
now quake broke somehow so it gets stuck even before it does any audio ioctls
it just says "initializing palettes"
The fuck
Maybe some disk corruption? Try regenerating the image
If not some system call logging
the question is also whether Limine is on the latest version
yeah judging from this video, the answer is not
it's not updated
@grand shadow please bumpity bump Limine to latest version, i fixed bugs that @fleet osprey reported a while ago
I havent bumped limine in a while and its in my todo list
I will do that and resend techflash an iso
if you want I can just do it on my local build
yeah remember, from when I was poking at trying to get procfs
can you also help debug ps2 Ill give you a cookie
I don't know anything about debugging PS2
If you can give me a list of changes to try I'll try them all of my machines
best I can give is
- did it throw an error
- any debug logs if any were added
- does it work when I try to use it
the answer being no to it throwing an error, and no for it working, on all machines I've been able to test
Change distrotype to minimal in the makefile to make things faster
Add a printf to the ps2 keyboard interrupt and also a
for (;;) {
bool timeout;
uint8_t data = ps2_read_data_timeout(100, &timeout);
if (timeout)
break;
}``` to the end of ps2_init in arch/x86-64/ps2.c
k, one sec
gonna try bumping limine first, since I can see if anything breaks here and now
because I'm not at home with my USB drives atm, so I have no way of booting bare-metal on my thinkpad (and ofc, my optiplex is at home as well)
I'm now confused as to how my PS/2 driver works on my chromebook, but Astral's doesn't...
is yours similar to mine? ^^^
idk
The mathewnd curse, ps2 will work on all machines I can test on myself but not on any others
you could always go look lol
that seems to be the biggest difference
mine doesn't actually do anything to init the PS2 controller or keyboard, just blindly assumes that both exist, and the keyboard will be firing on IRQ1, Astral's actually does it the "right" way
also, you're fine with bumping to Limine v8? that's 1 major version bump, you're on v7 rn
That should be fine just check for any config file changes
👍
welp, rebuilding clean now because I botched the command
lovely
this'll take a bit
it's just make DISTROTYPE=minimal, yeah?
You can change it in the makefile so you dont have to pass it every time
yeah, it totally did change, will fix
got one config working, no background or anything else working yet
won't have time to finish this sadly, gtg
looking good so far
all of the options seem to boot w/ no problem
er- well, they start the kernel with no problem
I don't have it set up for NVMe yet
but if that didn't work it wouldn't be a limine issue anyways
PR created with all of these changes now, btw
on my laptop I get "mm/alloc.c:getcachefromsize:45: cache failed"
after it prints the pci device list
my bet is that its uacpi that's allocating more than 64k for some acpi stuff
make disk run-disk-kvm
that will get you "set up for nvme"
yeah I was right, adding a couple more sizes up to 1mb fixed it
yeah and that works too
probably could've tried before submitting, but I'm also busy :P (tbf I did see it fail to mount /dev/nvme0n1 so I knew the args in limine were working)
ps2 keyboard doesn't work on my laptop either (at least this boot it doesn't)
it didn't even time out or anything from the looks of that log
It might really be that it has some bogus data in the output buffer that prevents keypresses or some shit
Idk
does this image have the new ps2 stuff?
Yeah
okay perfect
And a basic install of xorg
yep thats mainly what i wanted
i just didnt know what packages to use
and a full distro iso was 2.4G lol
i accidentally built one
Though dont expect it to work lmao
I sent the packages up here
Here
Also nice hda and nvme seem.to initialise in real hw
ok im gonna test it brb
should i use csm?
or does ps2 emulation work under uefi too
I already confirmed earlier that NVMe inits on all of my machines, but good to have more test cases
it depends, on all my pc's it doesn't
I think for uefi you have to enable it
At least on my machine I had to enable emulation
Cuz it had a real controller
damn i got the same thing as qwinci
if I had keyboard working I could also try playing some song on it (though its slightly annoying that the volume is at the max by default iirc and I don't know which one of the output paths is for the headphones)
if you don't need xorg then I can send my iso
Ugh I dont like having super big slab sizes because it pre allocates some
i wanted to test it so ill just build my own
And ends up using a ton of memory
just create them on demand
I do that its just that I dont really free them when theyre fully empty yet
I think I have all of the logic I just dont call it
If uacpi passes a memory size I can just make it use vmm_map instead of alloc
To free
maybe there could actually be some "non standard" symlinks with the device types as their names so then you could link that to /dev/dsp to make that the default
or you could just log what corresponds to what on boot
ah alloc_init
thank you
i was about to ask
🙏
also i couldnt really do non-uefi boot because for some reason this usb has fucking grub in its mbr
anyway, attempt #2
rip
uacpi 0 processors
Do you have a real controller and anything connected?
god bless
LMAO
nope, it should be emulated
it means that there are 0 legacy processor objects btw
I got something like that on my computer when I didnt have anythingplugged to ps2 but it wasnt emulating
(obligatory acpi test)
on my laptop it didn't because it uses ec
w h a t
Like
My pc has a real controller
And when I didnt have anytjing plugged into the ports
It had the same fails
Which madr me realise I had to turn on emulation in the bios
I should really remove this, it confuses people lol
Yeah it can be enabled optionally
well i have nothing regarding ps2 or emulation in my firmware settings
Also 400 devices jesus
so i assume i need to use legacy boot
They went all out on this aml blob
aka csm
aka i need a disk image instead, i guess
so i can flash it to the drive
and overwrite grub
why not just dd the iso to the drive?
actually idk
im on windows
and i use rufus
ill try to mount the usb in wsl
unless someone has a better and easier idea
netboot
(assuming you have a second pc) idk how slow would it be with these initrd sizes tho
its ~250MB so
also no 2nd pc
at least thats easily available to me
well its under my desk
but i would need to plug in a display
blah blah blah
Isnt there an option in rufus or smth
also now I had ps2 working on my laptop for 2sec after boot but when I started typing stuff then it got stuck
I have a lot of laptops it least
I've tried rufus, it just won't work on BIOS
Please I have no idea wtf Im doing wrong
all of my machines either hang, or say that the boot failed
what did you end up doing?
Ill give you a cookie and a big thank you
free cookies lifehack
give up until I eventually make a make img option that makes a boot HDD/USB image directly
vs make iso
ok well ill make one then
sure ill do it some time soon ™️
btw @grand shadow, since the message kinda got burried and idk if you ever actually saw it:
limine v8 PR - https://github.com/Mathewnd/Astral/pull/9
I got the email Im on the bus Ill look at it when Im home
ah
And tell me what I did wrong if you find out cuz I really am curious
im not gonna be using ultra legacy as base probably, ill look at proper production quality implementations
i want this to work everywhere
im kinda past the stage of adhoc crappy drivers
Ps2 was harder to make work on real hardware than like nvme damn
I guess it makes sense
it makes sense yeah
same reason why ide is harder than nvme
years and years of legacy crust
bruh hdd.img has no partition table
almost like i forgot
i wanted to bios-install --force-mbr then i realized
bruuuuuuuuuuuuuuh what to do
ill use ventoy i guess
ventoy breaks it
initrd won't load
well ill try it anyway
i mean, nvme will be the same in 20 years
just like ahci did before it
then it's all uniformed into ugly scsi on windows
ahci being sda yes but is nvme?
it really needs to die
you're gonna want SCSI support if you want to ever support USB storage
yes, thats the unfortunate part
also ufs uses scsi
yeah but it doesnt mean that you have to convert every disk format into scsi
wdym?
afaik linux blockdev isnt necessarily scsi
ahci is, and that's why disks are named sdN
but nvme isnt
but ill have to check
oh idk, i know there's like a giant scsi thing for USB, IDE, and AHCI
yeah that's for sure
like part of the kernel
its a very slow subsystem
with too many layers of abstraction
IDE is actually different last I checked, isn't it like /dev/hd[x]?
yeah i think so idk
does work either under csm :(
USB and AHCI are indeed turned into SCSI tho
maybe my firmware just doesnt do ps2 emulation
alot of new machines dont at all
my main desktop has an option for it in the firmware
i guess i have to finish my xhci driver then
and has physical ports too
sadly I don't hae a physical PS2 kbd, nor a USB one low-power enough to use with an adapter
I only have fancy gamer RGB keyboard that needs 5V @ 0.8A or something
I am interested in testing that with the quirky weird usb 1.1 mouse that I have from 2002 
yeah
hopefully u finish it before i unfuck ps2 for astral
i have one too
hell no
i find my 2003 ms mouse too comfy to switch from it :^)
have fun unfucking ps2
i have a pic of 3yo me with it lmfao

yup, that's the ventoy skill issue
it fucks the initrd
i have some experience with a relatively stable driver for it, but yeah
ventoy
then i guess you'll actually have fun ;^)
so far it failed on managarm and my own kernel, it just sends transaction error for the first get descriptor command no matter what I tried (when its attached on boot it sometimes works tho)
I have no idea what actually is wrong
I also like PS2, specifically because of this :)
lol
if you mean resetting the device and then reading the first 8 bytes of the device descriptor that's what I tried to do
yeah
but it always fails with the transaction error
I also tried different packet sizes but no luck
what does linux do ^:)
idk
shove log messages in linux then figure out what init it does
at least it works
it should count as black box reversing so you dont even need licensing bs
@carmine swallow if you send me an iso with hda and the new ps2 I can try it out on my desktop and laptop
linux has tracing in the xhci driver that you can enable at runtime
Cuz ps2 works there
sure, Ill just put the song back to it because I got rid of it to make it faster to flash 
not that it helped me debug the managarm driver :^)
yeah, it doesn't seem to log all that much about actual init by default
techflash in ~ at Michael-ArchT14 ➜ sudo dmesg | grep -iE 'i8042|PS/2|PS2|serio'
[ 1.406297] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[ 1.410161] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 1.410257] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 1.602187] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input5
[ 8.508570] mousedev: PS/2 mouse device common for all mice
[ 9.558025] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694]
[ 9.594049] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..]
[ 9.594069] psmouse serio1: synaptics: Your touchpad (PNP: LEN2064 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to [email protected].
[ 9.660605] psmouse serio1: synaptics: Touchpad model: 1, fw: 10.32, id: 0x1e2a1, caps: 0xf014a3/0x940300/0x12e800/0x500000, board id: 3471, fw id: 2909640
[ 9.660655] psmouse serio1: synaptics: serio: Synaptics pass-through port at isa0060/serio1/input0
[ 9.721786] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input16
[ 10.267028] psmouse serio2: trackpoint: Elan TrackPoint firmware: 0x12, buttons: 3/3
[ 10.508459] input: TPPS/2 Elan TrackPoint as /devices/platform/i8042/serio1/serio2/input/input22
[ 11.577124] psmouse serio1: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 5 bytes away.
i meant add debug prints to linux
oh yeah i can use uacpi now to detect the touchpad and stuff
on astral
so thats nice
yes, that's what I said lol
it doesn't log that much by default, so you would indeed need to add new debug messages
is nvme too?
no
a lot of oses scsify everything
maybe Ill try that
nvme is its own thing
at least, it isn't in Linux
enable in /sys/kernel/tracing/events/ and for the actual trace/sys/kernel/debug/tracing/trace
here, hopefully the generic device class match works for your hda controller, I did also add intel tigerlake smartsound technology id to it manually because that's what I have on my laptop
if there are multiple outputs then each different output should have their own /dev/dspX file you can cat stuff to, though like I said you can't really know which one of them corresponds to what physically rn
100%
or headphone-exploding
it shouldn't be that loud at least on all hardware that I have tested it on, for an example its not the same as max software volume in linux
but better be careful ig
if you find the correct output then in theory yes
no it doesn't, on some machines there actually are many different outputs for eg. different kinds of output ports like hdmi and different kind of analog outputs
💀
Does your hda loop not support interrupble sleep for like ^C
yikes
is there something that I have to do for that to work? because if yes then it likely doesn't
What do you use for sleeping

