#Nyaux
1 messages ยท Page 44 of 1
the cpu has no integrated graphics?
then I doubt anything is wrong with the gpu
is there a way to use that instead of dedicated
that would be the default
it depends on how you configure the OS
bios*
yeah i guarantee its not the gpu
have you tried booting it no standard battery or cmos battery?
OS
which laptop is it
yes
no luck
and does the laptop have a BIOS backup which can be used to restore the BIOS?
no
oh
because the issues sounds like it could be the bios
I've had the BIOS in my laptop randomly corrupt itself
idk man im royally fucked
you may be able to repair it
does your laptop not have a way at all to restore the BIOS if it gets corrupted?
somehow
no
how
idk then
idk it depends on what the issue is lol
soooo who wants give me free laptop
@haughty kite come to cork and get me one
๐ก
no

maybe try contact acer support and see what they say?
you can still contact companies for support without having warranty
they won't be able to fix it for you for free
im not waiting
4 weeks
im already so fucking done with acer
i just want a gaming laptop from a different manufactor
problem is
im poor

now i could do this thing where
i buy a laptop from very and pay it per month
but my dad is def gonna go and try and fix it
i dont think they will
since its a motherboard issue
and it will take weeks
plus i cant find a new preadtor pt14-51 motherboard online
so
๐คทโโ๏ธ
did you at least look for your symptoms in the mobo manual
theres no fucking mobo manual
๐
what u think acer is like HEY lets make a mobo manual for this fucking laptop
๐
bro its fucking acer
do u think they care?
I'm trying to tell you that one of there online technicians might be able to give you some other things to try without having to send it away
no i think you cant search the fucking web
user manual
seems like what would tell you there is an issue
on their website lol
third search result for "acer preadtor trition 14 schemaitcs"
bro
when u turn the thing on, does it actually turn on, just no output?
and u cant enter bios
most of the error messages just say to contact the dealer
yea
yeah i think thats probably the best option lol
no, contact acer
dealer*
"Contact your dealer or an authorized service center."
I think acer counts as an authorized service center or dealer
I think you should expect it to take weeks unless u can fix it yourself
bro im not waiting weeks
im a spoiled teenager after all
you talk to acer support online
they are closed
its new years eve give them a break
tbh you'll prolly just get someone whos gonna ask some basic questions and then refer you to a service center
^
worth a shot though
can i have ur laptop wux
they might have diagnostic info
do u know whats looking good rn
this rog strix g16 laptolp
anyone have a spare small bit of money
very small
just 2k
prwtty pwease
๐ฅบ
this laptop
omg
120hz oled
bro
make me a desktop that isnt heavy and has a built in screen

oh wait
thats a laptop!
laptops are so expensive compared to the shitty performance
my 2k laptop works about as well as a pc I could get for 400$
oh my god
this is beautiful
i dont mind the laptop gpu downgrade
since i get 120hz oled

my integrated gpu works as well as the discrete one
I put it in offload mode and have never used it since
tbf the discrete is fairly shitty
๐คข wtf
buy an old used thinkpad
you can get good deals for like 250โฌ
yeah, but what if you need it to be portable
I'm not talking about expensive gaming laptops
they're kinda cringe and clunky
and overheat
and don't have long battery lives
but like
just a cheap used ThinkPad
more then enough for most OSDev needs
unless you need to test on particular hardware and such
look at all those thinkpads
and then if you have a $2000 budget
you still have $1700 left for a pretty good gaming desktop
see?
u cant game on it tho lol
even a midrange macbook would be less than 2 grand lol
yup
u cant do anything on an old thinkpad
who needs to game anyway?
nyaux
factorio is a critical part of life
I'm using an old thinkpad
but you can surely run that on an old thinkpad
u cant run the games nyaux plays on an old thinkpad
not well lmfao
then just buy a desktop then
sometimes people like moving
he wants something portable
this is not a solution for everyone
that said i dont think i ever had a laptop that cost 2k
I was able to run Minecraft 1.7.10 on a Netbook from 2007
bro it's minecraft
1.7.10 is ancient
and it's 1.7.10
no game, only osdev
ofc at like 20 FPS at 2 chunks render distance
and cpu is very hard on cpu
๐คฆโโ๏ธ
so it cant
it's playable
no its not
20 fps isnt playable
I've played Minecraft at 20 FPS for years
also factorio isnt super playable at less than 60fps
that doesnt qualify as playable
a lot of games arent either
(its fixed tickrate)
just because you put up with it doesn't mean it's playable 
how do you think people who couldn't afford to spend $3000 on a PC in the mid-1990s played Duke Nukem 3D or Doom?
game at 59 fps
literally unplayable
different times + ^
nah
59 is still fine
20 FPS is playable
^
- depends on the game
yeah that
yeah you don't want to play multiplayer games at 20fps at least
yeah this
you can play at 0.000001 fps
you need to enjoy playing for it to be playable
this guy probably used to hundreds of fps won't enjoy it
you can get used to it
bro if i can watch a youtube video in a higher framerate than i can run minecraft at i will not enjoy minecraft more than a random youtube video
?????
it's about interactivity
a YouTube video is not interactive
well
it can be
but it usually isn't
lol
especially a random one
I think that's what he's saying
anyway this is very much not an experience i'd recommend
ok, but chess is still interactive, even if you can't do more than 20 moves a second
chess match rn
you and me
no
so lower frame rates are not enjoyable anymore
20fps is like very visibly stuttery
exactly
that reduces the amount of fun you get out of the game
you get used to it again after a week
why should i when i can just not
my experience with playing satisfactory is that you very much do not
does Nyaux have $2000 to spend on a laptop?
but anyway this is not a viable option
probably not but he probably also doesn't want to downgrade for reasons
what would you choose:
30fps highest possible graphics
60fps medium
a 200$ thinkpad is not a viable option by any stretch of the definition
60fps medium
^
yeah
for sure
also some games (factorio) are lockstep, you dont get half of the frames
you get the same frames, at half the speed
which is a lot worse
ofc 60 FPS medium
why not pc
...
because he needs a portable machine, I guess
to play games on
but graphics just look so good on maximum
๐ฉ
what game are we talking about?
who cares what the graphics look like
lol
eh, just an excuse for people to buy a new PC every 5 years
when you're flying at mach 1.2 just 7 metres above the ocean it's incredible
my computer has been with me for 12-15 years, I only change parts in it
ship of theseus
what are the specs?
nice
ah yes nyaux discussion
fastfetch is faster
I think it's inside the actual neofetch script
maybe
fedora is pretty based
what does that mean
fedora is generally unstable
and what does that mean?
idk just said
buy a pc
zamn
osdev on termux
he does
common apple L
you can but its not allowed on the app store
you can?
i thought you straight up could not
thats a new thing ig
oh its probably the browser stuff
if you're blessed by apple
thats why i think chrome uses apples js thing on ios?
chrome is just safari with a facelift
i do
Does she have good internet?
ehhh its decent
You can stream games from desktop
i dont have a desktop
๐
and if ur talking about the family computer
i cant
my sister uses it
Get a laptop + desktop
i dont have money
If you have 2000$
Then why were you looking up (obnoxious and) expensive gaming laptops?
Also idk if it's a good advice, but even iGPUs on new laptops are decent
Like don't buy gaming ones
Like what
overwatch
(x) doubt
val
lmao
not at 240hz
they run on potatos
244hz
WHO THE FUCK NEEDS 240hz ๐ญ
cringe.
i have a monitor at 244hz
i have a 165hz monitor and i can definitely notice the difference
just on the desktop
I have 2 monitors, my old one is 60 and it's like looking at a slideshow compared to 144
yeah comparing my laptop's screen to the external monitor it's quite jarring
its fine yk what
ill save up for a new desktop
i get 50 euro every week
50 x 4
200 euro
200 x 3
Also you're turning 18 soon (?)
You won't have to be visiting your mother if you don't want to
So like get a good laptop which isn't cringe and you could also use in college (if you go that route) instead
nah ill do an sfx build
and ill somehow make a bracket for the portable montior with my 3d printer
You can also probably buy a new motherboard for your laptop?
you might be better off saving up to an amount where you can get a enough parts for a working system, then expand on it as you get more money
so you don't have mismatched components due to products disappearing for some reason
i wont buy the gpu and cpu til last
tbf
yeah the framework laptops are pricey :/
imo its worth it, but definitely not budget friendly, I agree with what frosty was saying earlier though
.
Am hav framework laptop, can confirm
@surreal path here you go. doesn't look too bad for just ascii
.:. ---:
*..#-. -# .-*
* :=.+*. :*--= ++ :*
:#. :*=:=+%- #. -+:.++: ----. %- +=
--== .:#. :*. .-*+-:..:=+---. :# -+ =#: +-
%# =-: #: :=*=-.. .::. .-+=. =* .%++.: .+
-% * .+==:..=- -:::: :*= +: -. .#= *
=+ :=. # =*. : -=*###**+ -*. :#.-- . +-
=+. -@=: -# =%@@@@@@@@@@+ .*. -*# -*:
:+--=+ .* *@@@@@@@@@@@@@@- .# -+--+=:
.. -+ *@@@@@@@@@@@@@@@@- *: ..
== *@@@@@@@@@@@@@@@@@@. +:
+: :@@@@@@@@@%@@@@@@@@@% +:
+: +@@@@@@+: .:+@@@@@@+ *.
-+ #@@@@+ :%@@@@@. -*
%+.@@@#. .#@@@@-:#.
.# .=- :+*- +-
=+-*: -: :+.
.:==--:. .:-=:..
::--:---:--:-..
Nyaux gofundme when?
he bricked it
surprisingly it wasnt Nyaux that bricked it
allegedly
LOL
that wouldnโt even brick it lol
we have no idea if its a mobo issue tho it could be literally anything
including the display panel being fucked and that breaking post
idk could happen
classic qemu
U can probably crash the laptop too. but bricking it is a whole other feat
yeah its very hard to do from software
wait he said his keyboard blinks twice
I wonder if thats like the equivalent of a mobo beep
he said nothing comes up on screen
could just be random shit or undocumented
I doubt the laptop has serial, that he has a serial cable, or a machine to which debug the serial output with
not to be a pessimist or anything lol
ask fucking support
oh they defo have serial on the mobo
that wont work lol
Because devices need drivers.
Yeah, I suppose. More meant there wont be an port for it
yeah lol
And this is USB
0 chance for that
it would just be some pins on the board
yeah fair, didnt think of that
You'd need to iterate USB, find devices, happen to notice this one and initialize your driver for it.
That is far harder than getting a bootloader like Limine to just give you a framebuffer for example.
Well then it needs to plug into something it is compatible with
And USB certainly won't be initialized before POST.
unless u have something relatively cursed going on
lol
most likely its meant that the thing receiving the output is plugged into the usb
and the thing ur debugging is connected over serial
to what
legacy PCI lmao
it's a laptop
even if it was a desktop the chances you had legacy PCI is slim
you also cant use random debugging cards
and no you cannot cut in half legacy PCI to fit in PCIe, that makes no sense
it kinda is though
no no that's totally how it works
it is
i meant the random debugging card part
not the legacy pci part
if you have a dumb PCI(e) card that uses port 0x80 i don't see the issue with it
yes correct
how do you make sure the bios allocates port 0x80 to your device
also you still dont have any manuals
pci is packet switched afaik so yes i think you do
does PCI not have any mechanism to tell the BIOS to assign certain ranges of IO ports to a card that requests it?
sounds like something it should have
i dont think so
how do serial pci cards work then
how do you make sure bios allocates the right ports to the card
i am not sure
what's the difference lmao
i think this mechanism exists
they are not even that old and nobody is buying them lol
probably because pci devices can just yell at the bus and get what they want
ok then please check for us lol
(read: i am lazy to ๐ดโโ ๏ธ the spec and check myself)
ok you know what
@restive dock you prrrobably know
do PCI cards have a way to self assign IO ports at boot
is that PNP perhaps?
or something older/more basic
as i said im pretty sure pci devices can yell at the bus and get what they want
thats how dma works, except iommu can control that
oh maybe
and there are some bits in the config space to maybe disable that but idk how that works
doesn't matter
same
PCI existed since forever
i seem to have the same 2019 pcie 5.0 version that coolbird has somehow
very convinient
its probably within the base spec if anything but it contains so much stuff its hard to search
credits ๐
does the pci spec really have x86 specific stuff?
that sounds dumb
judging by the fact its used outside of x86
reminds me of qualcomm bus stuff where you have some arbitration garbage
its just general io as far as I can tell, not x86 specific
okay so routing for IO port stuff looks like this
address, length, some other crap i dont care about
ok
okay so i didnt figure out if you can do that
but i did figure out that if your pci port is behind a bridge you are likely fucked
isn't every port behind a bridge
or like at least 90% of the ports
that makes no sense
yeah i concur with the czapek
is there any PCI expert in here?
that said im like 99% sure its bios assignment
that meaning what?
look at seabios then
if it is a bios thing the code must be there
seabios works on real machines
also since IO ports are described in AML there must be some static description of them, but its a matter of whether it is used during boot to configure it so the devices can use those IO ports or not
but i am pretty sure most AML isn't generated at runtime, so the IO ports being there are probably hardcoded
meaning it's merely a suggestion and the device can do anything it wants, just like with DMA
(except that DMA can be configured by an IOMMU)
my guess is that if the device starts with a nonempty bar then the bios uses that as a hint
no need to guess
you can verify that by peeping the seabios code!
(i am too lazy to do that, and i have my opinion already)
(im also more than happy to be proven wrong)
i am trying
this is defo done in qemu though
or libpayload
lol
or else im blind
Are you even doing osdev if you've never crashed qemu? 
why would it be done in qemu
that means its not bioses responsibility? then whose? the cpus? the host bridge? that makes even less sense
It probably has mPCIe for SSD or WiFi
idk man but it sure feels like qemu is the one doing it
okay time to read coreboot code
sure qemu needs that tho
i give up
seabios allocates the port range, after looking at the code I am pretty sure it doesn't care about whats there to start with
fuck pci
how does it configure it tho?
as in, what does it do with the allocated port range
writes it to the bar
once you have the port you tell the device
i know how the bar allocation stuff works
on paper
?
you figure out where the device needs to have its stuff
i forgot the BAR can hold system io addresses
and then you tell the device
๐
I KNOW!
shkwve even has code to do this stuff
Are the BAR I/O addresses the ports that x86 uses for in and out insns?
so like, the device tells you where it wants its junk and then you just allocate it there?
no i dont think so
so what i thought it works like is this:
- bios looks at all the io bars and their sizes
- bios picks a base for each io bar
- bios writes that base into the io bars
- profit
yea
it doesn't
but that is missing the step where qemu does stuff
its memory mapped
they only do mmio BARs
you get a DT range
with the offset
you find a device with the pci-host-ecam-generic compatible
then get the ranges prop
Oh well in that case I already support that :P
then do a bunch of parsing and one of the things in there is the address that an io range maps to
theres a type field in there
I know
type 1 is iobar
Because I implemented all of this literally a couple days ago.
lmfao
pub fn pci_ranges(self) -> impl Iterator<Item = PCIRange> {
self.u32_items().array_chunks::<{ 3 + 2 + 2 }>().filter_map(
|[flags, bus0, bus1, cpu0, cpu1, size0, size1]| {
let size = (size0 as usize) << 32 | (size1 as usize);
let cpu = (cpu0 as usize) << 32 | (cpu1 as usize);
let bus = (bus0 as usize) << 32 | (bus1 as usize);
let spacecode = (flags >> 24) & 3;
let range_type = match spacecode {
1 => PCIRangeType::IO,
2 => PCIRangeType::Bar32,
3 => PCIRangeType::Bar64,
_ => return None,
};
Some(PCIRange {
typ: range_type,
size,
cpu_addr: cpu,
bus_addr: bus,
})
},
)
}
this is what you can generously call my pci ranges field parsing logic
you said "this is where qemu" something
At some point 
i still think that
the device can read/write any io address
and that is only so the IO address can potentially be remapped
in case of conflict with other devices
IIRC those PCI POST code cards work by snooping the bus for any writes to port 0x80. That's simple enough it can probably be made on a CLPD or tiny FPGA.
ah, that would make a lot more sense
okay but that doesnt make sense
i have no idea, take what i say with a grain of salt
think about it: the pci bus is really fucking fast
PCI, not PCIe
exactly what i was trying to say
i think that is what they do
it can just intercept anything on the bus
but that doesnt explain pcie
yeah, no, pci-e does io virtualization
so that must be a bit more complicated
or maybe not? who knows
legacy PCI is a normal bus i think
According to a quick glance at the ol' search engine, PCIe doesn't support the same method of POST code card.
PCI express is some packet switched network memes
yeah i don't think you can snoop around like that
and you wont find the legacy shit at all
ok sure but like
coolbird
the picture they showed when you all went like "haha can't work lmao", it was legacy PCI
on both counts
not PCIe
oh the second has PCIe on the side
i didn't even fucking notice it the first time around lmao
maybe that's for a different thing
not port 0x80 debugging
see how it has 2 displays
@surreal path have you tried removing all the storage?
yea
why are we yapping in my thread about how to fix a broken laptop lol
its good
dw
about it
tmrw we sending it to the repair shop (if i dont sleep all day ofc like i did today)
also my bad for no nyaux development yesterday, it was just a shock that my laptop broke so wasnt in the mood to impl much other then adding a cpu id function into basic.h
catch up on sleep now so u dont have to sleep when nyax dev
i got my sleep
i slept all day lmao
anyways we do nyaux dev in like a bit im watching the new squid game rn lol
btw @silver yarrow u should watch the new squid game
its so good
anyways todo list today is:
improve scheduler queueing logic
figure out how tf does blocking threads work and impl that
if that was somehow done today then make uacpi use the scheduler to create threads that do work for it and such
if SOMEHOW i finish ALL of that today then its vfs time
blocking threads is as shrimple as taking it off the run queue
ah I saw it but didnt feel like it watching it. Ill watch it on my flight home
and optionally, adding it to a list of waiters, if you are blocking for that reason
yes but HOW long is ze question
and when do i do that lol
when you need to?
you don't just block threads for no reason
think back to the time you implemented interrupting waits in obos
what is it just like a function thats like
unblockthread()
or some shi
and what you saw there
pretty much
I call that function ThreadReady
because it makes the thread "ready for execution"
what does uacpis waitforworkcompleteion do
and how does ur function know which blocked thread to make readyu
do u like take a handle or smt, tid? or like smt else
it takes a struct thread*
yes
?
usually when you block a thread, you put it on a list
waits until all scheduled work is finished
like blockedthreads
yea im getting u
BUT
am i supposed to be constantly checking until the thread* doesnt exist
this list is not cpu-local
@finite summit https://github.com/OBOS-dev/obos/blob/4cfb3751eab65210eee0686c231bf99c51c4042f/src/uACPI/kernel_api.c#L391 this should be base + len > ...
think back to obos' struct waitable_header
so its not cpu local but global?
wrong obos
wrong
oh
oof
.
that's rewrite four
cant remember xd
Because there's a ton of very smart people here and it's a very interesting problem
๐ญ
fairr
gnu/obos when
IT IS MASTER
wait it is
lmao
you're still on an old commit
idfk
yeah whatever
idk why you'd even check it
๐ข
that function does nothing anyway
lol
well no wonder nyaux is cursed then
๐
like in
struct spinlock_t {
// spin lock stuff ^
struct waitable_header *hdr;
}
???
not spin lock
all my locks are spinlocks
lol
when you acquire a spinlock you busy wait if its contended
as in spin til its unlocked yea
when you acquire a mutex you block the thread (and switch to some other one) if its contended and then when the other thread unlockes the mutex it wakes you up again
oh so its like a lock multiple threads can have, and u block ze thread if its contended. im guessing in ze scheduler u check if its unlocked and if it is wake ze thread up
oh okayyyy
makes sense
no
oh i see
so if a lock is contended (locked), you block the current thread, and add it to a list
then when the lock is unlocked, the mutex implementation will take that thread from the list
and wake it
how does the futex know
like
if its code isnt being executed
wut
know what
as in
say u have a futex to something
okay ur a thread
u try to lock
uh oh its locked already
u block
right
that's not what a futex is
oh
obos_status Sys_FutexWait(uint32_t *futex, uint32_t cmp_with, uint64_t timeout);
obos_status Sys_FutexWake(uint32_t *futex, uint32_t nWaiters);```
if *futex==cmp_with, block the current thread, add it to a list
cmp with?
look at the god damn function
im looking
then in wake, it chooses nWaiters threads that are waiting, and wakes them
lies
my eyes are staring
cmp with another futex?
what
no 1 why is it a u32
no 2
is it comparing with another futex or what
no
no
it compares the value at *futex with a value that's also supplied to the syscall
you don't have to care about what the value is, its just an opaque 32-bit value the userspace supplies
^
oh i see
do I need to be extremely specific when I speak to nyauxmaster
then it blocks the current thread if they don't match
iirc
im sorry i struggle to understand things sometimes, like these concepts may seem trival to you but i never heard of this before so this is my first time learning this
struct futex {
uint32_t val;
struct waitable_hdr *hdr;
is it something like this
not quite
*if they match
oop
because userspace only passes you a pointer
to an arbitrary place in memory
that's basically your futex handle
so you would basically have a map of uint32_t* futex to struct waitable_header*
at least that's what I do
and also what keyronex does (?)
and the deref of futex is the value
and probably what a lot of other kernels do
yes
would u have a global map of this?
no
It gets fun when you have shared memory
oh
Between processes
per process for private futexes which are all you care about rn
oh so each process has its own futex map thing
yes
if (*futex == cmp_value)
block()
else
return EAGAIN```
can't you have futexes on shared memory?
that's basically what futex wait does
Anyway, futex is a mutex with "optimizations", which lets you not call kernel if only one thread is taking it (?)
what is "egagain"
EAGAIN is a posix error
an errno value
oh yea kk
okay this makes sense now
what it means is "retry the operation"
yes though you have to specifically not specify the FUTEX_PRIVATE flag when you wait/wake for that
Anyway, you probably need kernel mutexes
what
โ ๏ธ
What map
uint32_t futex -> struct waitable_hdr
*uint32_t*
its actually a good thing that I got reminded of futexes and looked at my code, I spotted a mistake that I made when changing it around yesterday 
My kernel doesn't have futexes 
aren't aligned accesses to memory always atomic?
no i mean whats ze difference between kernel ones and non kernel ones
as u mentioned mishakov
futex and mutex are difference
oh
*different
whats the difference exactly
everything
not guaranteed on !x86
bru
Futex is a type of mutex
on x86 yes but on other platforms like aarch64 no
oh
and whats a "normal mutex"
I forgor about those arches
still a good practice
Just spam barriers everywhere and you'll be set 
Something which blocks a thread and waits for it to be unlocked
and how does that work exactly
Ill rather just do this proper thing 
Is mutex a particular case of semaphore? I don't remember
like
what makes it difference from a mutex
futex*
bru and whats the normal impl of mutex
it can be used to implement a mutex
None?
futex on its own is not a mutex
so why did mr omar man say "everything"
So, there are generally two types of locks
the one in the car, and the one in the door
One is spinlock (there are many various implementations) which spins in a while loop and burns CPU untill it can be locked
yea i have that
I have many unintentional spinlocks
Or, instead of spinning, you can block the thread and do something else
Then when the other thread unlocks it, it will unblock the thread
This way you don't do "useless work" while waiting
And let other threads run
(kinda)
spinlocks also usually call sched_yield
but that's besides the point
Idk there should be some name for it let me google
Fun
oh so like
if its locked already and u try to lock it block ze thread, otherwise lock it
if its unlocked by some thread, wake threads blocked waiting for ze lock
am i understanding this correctly THIS TIME
yes
like mutex is a lock which blocks the threads that haven't been able to acquire it
is impl like, u have waitable header inside a mutex structure this time instead of a futex to waitable header, and the mutex contains a waitable header and the waitable header contains a list of blocked threads that tried to locked it but couldnt because the mutex was locked already
okay so im guessing im wrong
fun
then how is mutex impl'd?
how is it shared between threads
how does it work
You want mutex for uACPI, right?
yea
Not for userspace
yea
I'm lost
As usual
Same as spinlock, but with ability to block threads
(btw spinlocks can also have lists
)
bro stop making this more complicated
That's what I was trying to explain the other day
is mutex a structure that has a lock and a waitable hdr which contains shit like blocked threads yes or no
The simple impl is C struct mutex { spinlock lock; bool acquired; thread_t list_of_blocked_threads; }
yes
thanks
No no no
If you're in a context where you can yield then you should just use a blocking mutex
I disagree?
Why
blocking is much slower than yielding
Priorities
still, there are cases where spinlocks are preferable
