#Nyaux

1 messages ยท Page 44 of 1

surreal path
#

anyways @haughty kite mind coming to cork to buy me a new laptop

silver yarrow
#

the cpu has no integrated graphics?

surreal path
#

it does

#

it also has a mux switch

silver yarrow
#

then I doubt anything is wrong with the gpu

surreal path
#

idk what happened

#

then

plush hearth
surreal path
#

๐Ÿคทโ€โ™‚๏ธ

#

no i literarly cant turn it on

silver yarrow
surreal path
#

the keyboard just flashes twice

#

default is hybrid mode

silver yarrow
surreal path
haughty kite
#

yeah i guarantee its not the gpu

plush hearth
silver yarrow
haughty kite
#

which laptop is it

surreal path
#

PT-1451

#

PT14-51*

plush hearth
# surreal path yes

and does the laptop have a BIOS backup which can be used to restore the BIOS?

surreal path
#

no

plush hearth
#

oh

#

because the issues sounds like it could be the bios

#

I've had the BIOS in my laptop randomly corrupt itself

surreal path
#

idk man im royally fucked

haughty kite
#

you may be able to repair it

plush hearth
#

does your laptop not have a way at all to restore the BIOS if it gets corrupted?

haughty kite
#

somehow

surreal path
plush hearth
haughty kite
surreal path
#

soooo who wants give me free laptop

#

@haughty kite come to cork and get me one

#

๐Ÿ˜ก

haughty kite
#

no

surreal path
plush hearth
surreal path
#

i used my wartney already

#

it expired

#

im fucking cooked

plush hearth
#

you can still contact companies for support without having warranty

#

they won't be able to fix it for you for free

surreal path
#

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

#

๐Ÿคทโ€โ™‚๏ธ

haughty kite
#

did you at least look for your symptoms in the mobo manual

surreal path
#

๐Ÿ’€

#

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?

plush hearth
# surreal path 4 weeks

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

haughty kite
#

no i think you cant search the fucking web

#

user manual

#

seems like what would tell you there is an issue

surreal path
#

no fucking way

#

bro

#

how

#

whered u find this

haughty kite
#

on their website lol

#

third search result for "acer preadtor trition 14 schemaitcs"

surreal path
silver yarrow
#

when u turn the thing on, does it actually turn on, just no output?

surreal path
#

no output

#

flashing keyboard

#

flashes twice

silver yarrow
#

and u cant enter bios

plush hearth
surreal path
haughty kite
#

yeah i think thats probably the best option lol

surreal path
#

@haughty kite

#

the dealer

#

is fucking harvey norman

#

and i will wait weeks

plush hearth
#

no, contact acer

surreal path
#

dealer*

plush hearth
#

"Contact your dealer or an authorized service center."

#

I think acer counts as an authorized service center or dealer

surreal path
#

they are fucking closed

#

acers support line is closed

#

til 2 hours

#

CRINGE

#

๐Ÿ˜‚

silver yarrow
#

I think you should expect it to take weeks unless u can fix it yourself

surreal path
#

im a spoiled teenager after all

haughty kite
#

you talk to acer support online

surreal path
#

they are closed

haughty kite
#

its new years eve give them a break

surreal path
#

new years and my laptop fucking breaks lol

#

great start to 2025

silver yarrow
surreal path
#

^

silver yarrow
#

worth a shot though

surreal path
#

can i have ur laptop wux

haughty kite
#

they might have diagnostic info

silver yarrow
#

if ur lucky

#

I have never had any service ppl ever be helpful

surreal path
#

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

silver yarrow
#

laptops suck

#

lol

surreal path
#

bro

#

make me a desktop that isnt heavy and has a built in screen

#

oh wait

#

thats a laptop!

silver yarrow
#

laptops are so expensive compared to the shitty performance

#

my 2k laptop works about as well as a pc I could get for 400$

surreal path
#

at least its portable tho

silver yarrow
#

yeap thats the only reason I have one

#

cant wait till im back home

surreal path
#

oh my god

#

this is beautiful

#

i dont mind the laptop gpu downgrade

#

since i get 120hz oled

silver yarrow
#

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

surreal path
#

to be fair

#

im in ur walls

#

anyways

#

ehhh

flat nymph
supple robin
supple robin
#

just build a mini itx pc

worldly condor
#

buy an old used thinkpad
you can get good deals for like 250โ‚ฌ

worldly condor
#

don't spent $2000 on a laptop

worldly condor
#

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?

thorn bramble
haughty kite
#

even a midrange macbook would be less than 2 grand lol

worldly condor
#

yup

haughty kite
#

u cant do anything on an old thinkpad

worldly condor
thorn bramble
#

nyaux

haughty kite
worldly condor
worldly condor
thorn bramble
#

u cant run the games nyaux plays on an old thinkpad

haughty kite
worldly condor
#

then just buy a desktop then

haughty kite
#

sometimes people like moving

thorn bramble
#

he wants something portable

haughty kite
#

this is not a solution for everyone

#

that said i dont think i ever had a laptop that cost 2k

worldly condor
thorn bramble
#

bro it's minecraft

haughty kite
thorn bramble
#

and it's 1.7.10

edgy pilot
worldly condor
#

ofc at like 20 FPS at 2 chunks render distance

haughty kite
#

and cpu is very hard on cpu

thorn bramble
haughty kite
worldly condor
#

it's playable

haughty kite
#

no its not

thorn bramble
#

20 fps isnt playable

worldly condor
#

I've played Minecraft at 20 FPS for years

thorn bramble
#

im sorry

#

but

haughty kite
#

also factorio isnt super playable at less than 60fps

thorn bramble
#

that doesnt qualify as playable

haughty kite
#

a lot of games arent either

haughty kite
thorn bramble
#

just because you put up with it doesn't mean it's playable tf

worldly condor
#

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?

edgy pilot
worldly condor
#

nah

haughty kite
worldly condor
#

20 FPS is playable

haughty kite
#

but it slows down

#

noticeably

thorn bramble
#
  • depends on the game
haughty kite
#

yeah that

worldly condor
#

dude

#

if you can play it

#

then it's playable

molten grotto
#

yeah you don't want to play multiplayer games at 20fps at least

thorn bramble
#

you can play at 1 fps

#

it's not very enjoyable

haughty kite
#

yeah this

thorn bramble
#

but you can

#

does that mean it's playable?

haughty kite
#

you can play at 0.000001 fps

edgy pilot
worldly condor
#

I enjoyed it

#

kids nowadays are just too spoiled

edgy pilot
worldly condor
#

you can get used to it

thorn bramble
#

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

worldly condor
#

after like

#

a week

worldly condor
#

it's about interactivity

#

a YouTube video is not interactive

#

well

#

it can be

#

but it usually isn't

haughty kite
#

lol

worldly condor
#

especially a random one

edgy pilot
haughty kite
#

anyway this is very much not an experience i'd recommend

thorn bramble
#

dw idk what im saying most of the time

#

but like

worldly condor
#

ok, but chess is still interactive, even if you can't do more than 20 moves a second

thorn bramble
#

it's about responsiveness

#
  • you get used to higher frame rates
worldly condor
#

no

thorn bramble
#

so lower frame rates are not enjoyable anymore

molten grotto
#

20fps is like very visibly stuttery

thorn bramble
#

exactly

haughty kite
#

yeah

#

20fps is not fun

thorn bramble
#

that reduces the amount of fun you get out of the game

worldly condor
thorn bramble
#

why should i when i can just not

haughty kite
#

my experience with playing satisfactory is that you very much do not

worldly condor
#

ok

#

but like

worldly condor
haughty kite
#

but anyway this is not a viable option

thorn bramble
#

probably not but he probably also doesn't want to downgrade for reasons

edgy pilot
#

what would you choose:
30fps highest possible graphics
60fps medium

haughty kite
#

a 200$ thinkpad is not a viable option by any stretch of the definition

thorn bramble
#

60fps medium

molten grotto
#

^

haughty kite
#

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

worldly condor
rigid fable
thorn bramble
#

...

worldly condor
#

to play games on

edgy pilot
rigid fable
worldly condor
edgy pilot
#

air battles

worldly condor
#

who cares what the graphics look like

molten grotto
#

lol

thorn bramble
#

some people do

#

thats why you buy expensive graphics cards lol

worldly condor
#

eh, just an excuse for people to buy a new PC every 5 years

edgy pilot
rigid fable
rigid fable
#

๐Ÿ˜ˆ ๐Ÿ‘†

worldly condor
#

what are the specs?

rigid fable
worldly condor
#

nice

finite summit
#

ah yes nyaux discussion

finite summit
rigid fable
#

i know only neofetch

finite summit
#

fastfetch is faster

rigid fable
#

fair

#

where is located a ascii distro images

#

for fetch commands

finite summit
#

I think it's inside the actual neofetch script

edgy pilot
finite summit
#

fedora is pretty based

rigid fable
#

fedora is non stable

#

my drivers had gone on fedora 2 times

edgy pilot
#

what does that mean

rigid fable
edgy pilot
#

and what does that mean?

rigid fable
surreal path
#

i need to game

#

at high refresh rates

#

i play a lot of multiplayer games

supple robin
surreal path
#

i go to my moms every weekend

supple robin
#

no pc on weekends then

#

just dont go

surreal path
#

my dad forces me

#

i have to

#

sadly

#

no osdev today cause laptop broken

#

:(

finite summit
#

zamn

edgy pilot
thorn bramble
#

inb4 he has an iphone

finite summit
#

he does

edgy pilot
#

common apple L

thorn bramble
#

ish exists

#

but it's an emulator

#

you can run qemu with jit if you sideload utm

haughty kite
#

you cant jit on iphones?

#

not unless you are webkit anyway

thorn bramble
#

you can but its not allowed on the app store

haughty kite
#

you can?

#

i thought you straight up could not

#

thats a new thing ig

#

oh its probably the browser stuff

kind root
#

thats why i think chrome uses apples js thing on ios?

thorn bramble
#

chrome is just safari with a facelift

surreal path
flat nymph
surreal path
flat nymph
#

You can stream games from desktop

surreal path
#

i dont have a desktop

#

๐Ÿ’€

#

and if ur talking about the family computer

#

i cant

#

my sister uses it

flat nymph
#

Get a laptop + desktop

surreal path
#

i dont have money

flat nymph
#

If you have 2000$

surreal path
#

i dont

#

๐Ÿ’€

flat nymph
#

Then why were you looking up (obnoxious and) expensive gaming laptops?

surreal path
#

because

#

idk

flat nymph
#

Also idk if it's a good advice, but even iGPUs on new laptops are decent

#

Like don't buy gaming ones

surreal path
#

nah i play mutiplayer games

#

i need ze gpu power

flat nymph
#

Like what

surreal path
#

overwatch

tender gorge
surreal path
#

val

surreal path
tender gorge
#

amd igpu would easily do both

#

im pretty sure

surreal path
#

not at 240hz

flat nymph
#

they run on potatos

surreal path
#

244hz

tender gorge
#

WHO THE FUCK NEEDS 240hz ๐Ÿ˜ญ

surreal path
#

also csgo 2

#

me

tender gorge
#

cringe.

surreal path
#

i have a monitor at 244hz

flat nymph
#

bro

#

I've gotten 144Hz recently

#

But 240

#

no

tender gorge
#

then again im biased because i cant tell the difference above 60hz

#

so idk

flat nymph
#

You can totally tell it

#

I can*

tender gorge
#

i literally cant

#

ive had friends literally do tests on this basically lol

tawdry mirage
#

i have a 165hz monitor and i can definitely notice the difference

#

just on the desktop

flat nymph
#

I have 2 monitors, my old one is 60 and it's like looking at a slideshow compared to 144

tawdry mirage
#

yeah comparing my laptop's screen to the external monitor it's quite jarring

flat nymph
#

Side by side

#

My laptop has 90Hz

#

And iGPU

surreal path
#

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

flat nymph
#

Also you're turning 18 soon (?)

#

You won't have to be visiting your mother if you don't want to

surreal path
#

yea

#

that too

#

anyways

#

let me think okay

#

i will buy the parts month by month

flat nymph
#

So like get a good laptop which isn't cringe and you could also use in college (if you go that route) instead

surreal path
#

and ill somehow make a bracket for the portable montior with my 3d printer

flat nymph
#

You can also probably buy a new motherboard for your laptop?

surreal path
#

no they arent online

#

u cant

plush hearth
#

so you don't have mismatched components due to products disappearing for some reason

surreal path
#

tbf

flat nymph
#

there's framework laptop

#

But I think it's expensive

surreal path
#

that gives a 6800s

#

yea

#

crazy expensive

desert haven
#

yeah the framework laptops are pricey :/

#

imo its worth it, but definitely not budget friendly, I agree with what frosty was saying earlier though

flat nymph
#

PCs don't really have a problem of mismatched parts though

#

afaik

broken depot
edgy pilot
#

@surreal path here you go. doesn't look too bad for just ascii

.:.                                                  ---:   
*..#-.                                              -# .-*  
* :=.+*.  :*--=                                      ++  :* 
:#. :*=:=+%-  #.           -+:.++:             ----.  %-  +=
 --==  .:#. :*.         .-*+-:..:=+---.       :#  -+ =#:  +-
  %#  =-:   #:       :=*=-..    .::. .-+=.     =* .%++.:  .+
  -%        *      .+==:..=-     -::::  :*=     +: -. .#=  *
   =+   :=. #     =*. :   -=*###**+       -*.  :#.--  .   +-
    =+.  -@=:    -#     =%@@@@@@@@@@+      .*.  -*#     -*: 
     :+--=+     .*     *@@@@@@@@@@@@@@-     .#    -+--+=:   
       ..       -+    *@@@@@@@@@@@@@@@@-     *:     ..      
                ==   *@@@@@@@@@@@@@@@@@@.    +:             
                +:  :@@@@@@@@@%@@@@@@@@@%    +:             
                +:  +@@@@@@+:   .:+@@@@@@+   *.             
                -+  #@@@@+         :%@@@@@. -*              
                 %+.@@@#.           .#@@@@-:#.              
                 .# .=-               :+*- +-               
                  =+-*:                -: :+.               
                   .:==--:.         .:-=:..                 
                        ::--:---:--:-..                     
silver yarrow
#

Nyaux gofundme when?

#

he bricked it

#

surprisingly it wasnt Nyaux that bricked it

finite summit
#

allegedly

silver yarrow
#

LOL

thorn bramble
#

that wouldnโ€™t even brick it lol

haughty kite
#

did he ask support yet

#

lol

thorn bramble
#

sone mobo issue

#

and he didnt do it apparently

haughty kite
#

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

thorn bramble
#

classic qemu

silver yarrow
#

U can probably crash the laptop too. but bricking it is a whole other feat

molten grotto
#

yeah its very hard to do from software

haughty kite
#

or the edp connector being deseated

#

and THAT breaking post

silver yarrow
#

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

haughty kite
#

ask fucking support

haughty kite
#

that wont work lol

broken depot
#

Because devices need drivers.

silver yarrow
haughty kite
#

yeah lol

broken depot
#

And this is USB

haughty kite
#

it would just be some pins on the board

silver yarrow
#

yeah fair, didnt think of that

broken depot
#

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.

silver yarrow
#

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

thorn bramble
#

to what

wicked loom
#

legacy PCI lmao

thorn bramble
#

it's a laptop

haughty kite
#

thats not how any of it works lol

#

๐Ÿคฆโ€โ™‚๏ธ

wicked loom
#

even if it was a desktop the chances you had legacy PCI is slim

haughty kite
#

you also cant use random debugging cards

wicked loom
#

and no you cannot cut in half legacy PCI to fit in PCIe, that makes no sense

wicked loom
thorn bramble
#

no no that's totally how it works

wicked loom
#

it is

haughty kite
#

not the legacy pci part

wicked loom
#

if you have a dumb PCI(e) card that uses port 0x80 i don't see the issue with it

#

yes correct

haughty kite
thorn bramble
#

you dont

#

and you dont have to

#

do you? lol

haughty kite
#

also you still dont have any manuals

haughty kite
wicked loom
#

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

thorn bramble
#

how do serial pci cards work then

#

how do you make sure bios allocates the right ports to the card

haughty kite
#

do they show up on those io ports?

#

i dont think so?

thorn bramble
#

i am not sure

haughty kite
#

the bios just has to allocate SOME io ports

#

which is trivial

wicked loom
#

think more like

#

think more like sb16

#

PCI cards

haughty kite
#

thats old pci

#

and no idea how that works

wicked loom
#

what's the difference lmao

haughty kite
#

i dont know tbh

#

hmm maybe there isnt

#

okay now i really dont know

wicked loom
#

i think this mechanism exists

thorn bramble
#

what spec?

#

it's paid

#

unless you find some old leaked version online

haughty kite
#

if there is my shit ass bootloader does not care

#

dont talk about crime

#

thanks

molten grotto
thorn bramble
wicked loom
#

ok then please check for us lol

#

(read: i am lazy to ๐Ÿดโ€โ˜ ๏ธ the spec and check myself)

thorn bramble
#

search for it

#

aint that hard

wicked loom
#

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

thorn bramble
#

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

haughty kite
thorn bramble
#

and there are some bits in the config space to maybe disable that but idk how that works

edgy pilot
#

2014

wicked loom
#

doesn't matter

haughty kite
#

same

wicked loom
#

PCI existed since forever

haughty kite
#

i seem to have the same 2019 pcie 5.0 version that coolbird has somehow

#

very convinient

molten grotto
#

its probably within the base spec if anything but it contains so much stuff its hard to search

#

credits ๐Ÿ’€

haughty kite
#

its a cool 1300 pages

#

so yes

thorn bramble
#

does the pci spec really have x86 specific stuff?

#

that sounds dumb

#

judging by the fact its used outside of x86

molten grotto
molten grotto
haughty kite
#

okay so routing for IO port stuff looks like this

#

address, length, some other crap i dont care about

wicked loom
#

ok

haughty kite
#

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

thorn bramble
#

isn't every port behind a bridge

#

or like at least 90% of the ports

#

that makes no sense

haughty kite
#

im not sure

#

actually maybe not

wicked loom
#

yeah i concur with the czapek

haughty kite
#

yeah i also dont know how pci works

#

this is stupid and i hate it

wicked loom
#

is there any PCI expert in here?

haughty kite
#

that said im like 99% sure its bios assignment

wicked loom
#

that meaning what?

thorn bramble
#

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)

haughty kite
#

my guess is that if the device starts with a nonempty bar then the bios uses that as a hint

thorn bramble
#

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)

haughty kite
#

this is defo done in qemu though

#

or libpayload

thorn bramble
#

lol

haughty kite
#

or else im blind

flat nymph
#

Are you even doing osdev if you've never crashed qemu? meme

thorn bramble
#

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

flat nymph
haughty kite
#

okay time to read coreboot code

thorn bramble
#

sure qemu needs that tho

haughty kite
#

i give up

molten grotto
#

seabios allocates the port range, after looking at the code I am pretty sure it doesn't care about whats there to start with

haughty kite
#

fuck pci

thorn bramble
#

as in, what does it do with the allocated port range

molten grotto
#

writes it to the bar

haughty kite
#

once you have the port you tell the device

#

i know how the bar allocation stuff works

#

on paper

thorn bramble
#

OH

#

WOW

#

YEAH

#

THAT MAEKS SENSE

haughty kite
#

ikr

#

incredible

wicked loom
#

?

haughty kite
#

you figure out where the device needs to have its stuff

thorn bramble
#

i forgot the BAR can hold system io addresses

haughty kite
#

and then you tell the device

thorn bramble
#

๐Ÿ’€

haughty kite
#

yeah lol

#

its an incredible technique

thorn bramble
#

I KNOW!

haughty kite
#

shkwve even has code to do this stuff

broken depot
#

Are the BAR I/O addresses the ports that x86 uses for in and out insns?

wicked loom
#

so like, the device tells you where it wants its junk and then you just allocate it there?

haughty kite
#

so what i thought it works like is this:

  1. bios looks at all the io bars and their sizes
  2. bios picks a base for each io bar
  3. bios writes that base into the io bars
  4. profit
broken depot
#

Interesting.

#

I wonder how that works for things like RISC-V.

thorn bramble
#

it doesn't

haughty kite
haughty kite
thorn bramble
#

they only do mmio BARs

haughty kite
#

you get a DT range

#

with the offset

#

you find a device with the pci-host-ecam-generic compatible

#

then get the ranges prop

broken depot
#

Oh well in that case I already support that :P

haughty kite
#

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

broken depot
#

I know

haughty kite
#

type 1 is iobar

broken depot
#

Because I implemented all of this literally a couple days ago.

haughty kite
#

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

wicked loom
#

ok but like

#

you did not finish your explanation

haughty kite
#

which one?

#

oh i dont know

#

i genuinely do not know how this works anymore

wicked loom
#

you said "this is where qemu" something

haughty kite
#

the bios CAN move the iobar

#

if it feels like it

#

idk how or when it would do that

broken depot
#

At some point trl

thorn bramble
#

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

haughty kite
#

i dont think it can handle reads

#

or it cant do it without conflicts at least

broken depot
#

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.

wicked loom
haughty kite
thorn bramble
#

i have no idea, take what i say with a grain of salt

haughty kite
#

think about it: the pci bus is really fucking fast

broken depot
#

PCI, not PCIe

haughty kite
#

you cant send every request to every device

#

oh pci

#

old pci probably

thorn bramble
haughty kite
#

i think that is what they do

thorn bramble
#

it can just intercept anything on the bus

haughty kite
#

but that doesnt explain pcie

thorn bramble
#

yeah, no, pci-e does io virtualization

#

so that must be a bit more complicated

#

or maybe not? who knows

haughty kite
#

legacy PCI is a normal bus i think

broken depot
#

According to a quick glance at the ol' search engine, PCIe doesn't support the same method of POST code card.

haughty kite
#

PCI express is some packet switched network memes

thorn bramble
#

yeah i don't think you can snoop around like that

haughty kite
#

and you wont find the legacy shit at all

wicked loom
#

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

flat nymph
#

Post codes are a byte

#

Maybe there's a different protocol?

haughty kite
#

either way none of this helps you

#

because you still dont have docs

spice yarrow
#

@surreal path have you tried removing all the storage?

surreal path
#

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

silver yarrow
#

catch up on sleep now so u dont have to sleep when nyax dev

surreal path
#

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

finite summit
#

blocking threads is as shrimple as taking it off the run queue

silver yarrow
finite summit
surreal path
finite summit
#

until it's put back

#

on the runqueue

surreal path
#

and when do i do that lol

finite summit
#

you don't just block threads for no reason

#

think back to the time you implemented interrupting waits in obos

surreal path
finite summit
#

and what you saw there

#

pretty much

#

I call that function ThreadReady

#

because it makes the thread "ready for execution"

surreal path
#

what does uacpis waitforworkcompleteion do

surreal path
#

do u like take a handle or smt, tid? or like smt else

finite summit
#

it takes a struct thread*

surreal path
#

takes a ptr to ze thread ?

#

okay

finite summit
#

yes

finite summit
#

usually when you block a thread, you put it on a list

finite summit
surreal path
finite summit
#

BUT

surreal path
finite summit
#

idk if you want to do it like that

#

sure

finite summit
silver yarrow
finite summit
#

think back to obos' struct waitable_header

surreal path
finite summit
surreal path
silver yarrow
finite summit
surreal path
spice yarrow
surreal path
#

๐Ÿ˜ญ

silver yarrow
#

lol

finite summit
#

master

#

certainly not old_code lol

silver yarrow
#

I thought it was master

#

wut

#

faenigfnew0gnu34w

surreal path
#

gnu/obos when

silver yarrow
#

IT IS MASTER

finite summit
silver yarrow
#

lmao

finite summit
#

you're still on an old commit

silver yarrow
#

huh

#

just went to master

#

its still the same

finite summit
#

ago

silver yarrow
#

idfk

finite summit
#

that is master

silver yarrow
#

that line

#

should be base + len >

finite summit
#

yeah whatever

molten grotto
#

idk why you'd even check it

silver yarrow
#

๐Ÿ˜ข

finite summit
silver yarrow
#

lol

finite summit
#

if acpi does something stoobid like going out of range on an io region idrfc

surreal path
#

okay theres a structure called waitable header

#

where is this stored

finite summit
#

in a lock, for example

#

do you really not remember a single thing you did

surreal path
#

no

#

i have bad memory

finite summit
#

well no wonder nyaux is cursed then

surreal path
#

๐Ÿ’€

surreal path
finite summit
#

not spin lock

surreal path
#

all my locks are spinlocks

silver yarrow
#

lol

finite summit
#

by lock I meant mutex

#

semaphore

#

event

#

rw-lock

surreal path
#

im confused as to the difference

#

time to get roasted xd

molten grotto
#

when you acquire a spinlock you busy wait if its contended

surreal path
molten grotto
#

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

finite summit
#

^

surreal path
#

oh okayyyy

#

makes sense

finite summit
#

no

surreal path
#

oh

finite summit
#

contended means you cannot lock the lock because it's locked

#

in the case of locks

surreal path
#

oh i see

finite summit
#

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

surreal path
#

like

#

if its code isnt being executed

finite summit
#

wut

molten grotto
#

know what

surreal path
#

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

finite summit
#

that's not what a futex is

surreal path
#

oh

finite summit
#
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

surreal path
#

cmp with?

finite summit
#

look at the god damn function

surreal path
#

im looking

finite summit
finite summit
surreal path
#

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

molten grotto
#

no

finite summit
#

no

molten grotto
#

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

finite summit
#

^

finite summit
#

do I need to be extremely specific when I speak to nyauxmaster

finite summit
#

iirc

surreal path
#

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

finite summit
#

not quite

molten grotto
surreal path
#

oop

finite summit
#

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 (?)

surreal path
finite summit
#

and probably what a lot of other kernels do

finite summit
surreal path
#

would u have a global map of this?

finite summit
#

no

flat nymph
#

It gets fun when you have shared memory

surreal path
#

oh

flat nymph
molten grotto
surreal path
molten grotto
#

yes

surreal path
#

correct?

#

okay

#

that makes sense

finite summit
#
if (*futex == cmp_value)
  block()
else
  return EAGAIN```
thorn bramble
#

can't you have futexes on shared memory?

finite summit
flat nymph
#

Anyway, futex is a mutex with "optimizations", which lets you not call kernel if only one thread is taking it (?)

surreal path
thorn bramble
#

EAGAIN is a posix error

finite summit
#

an errno value

surreal path
#

oh yea kk

surreal path
finite summit
#

what it means is "retry the operation"

molten grotto
flat nymph
#

Anyway, you probably need kernel mutexes

surreal path
thorn bramble
#

โ˜ ๏ธ

surreal path
#

cant i just

#

throw it in process

#

the map

flat nymph
#

What map

surreal path
#

uint32_t futex -> struct waitable_hdr

finite summit
#

*uint32_t*

flat nymph
#

Don't worry about futexes

#

For now

molten grotto
# molten grotto *if they match

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 troll

flat nymph
#

My kernel doesn't have futexes galaxybrain

finite summit
surreal path
#

as u mentioned mishakov

finite summit
#

futex and mutex are difference

surreal path
#

oh

finite summit
#

*different

surreal path
#

whats the difference exactly

finite summit
#

everything

thorn bramble
surreal path
#

bru

flat nymph
#

Futex is a type of mutex

molten grotto
finite summit
surreal path
finite summit
#

I forgor about those arches

thorn bramble
#

still a good practice

flat nymph
finite summit
#

anyway, I need to implement fork for obos

#

so I will be back (or not)

flat nymph
surreal path
molten grotto
flat nymph
#

Is mutex a particular case of semaphore? I don't remember

surreal path
#

what makes it difference from a mutex

#

futex*

flat nymph
#

Futex is a particular implementation of mutex

#

Idk

#

For userspace

surreal path
#

bru and whats the normal impl of mutex

molten grotto
#

it can be used to implement a mutex

flat nymph
molten grotto
#

futex on its own is not a mutex

surreal path
flat nymph
#

wait a sec gonna read wikipedia

#

according to it mutex is synonymous to lock trl

surreal path
#

bru

flat nymph
#

So, there are generally two types of locks

silver yarrow
#

the one in the car, and the one in the door

flat nymph
#

One is spinlock (there are many various implementations) which spins in a while loop and burns CPU untill it can be locked

surreal path
#

yea i have that

silver yarrow
#

I have many unintentional spinlocks

flat nymph
#

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

surreal path
#

am i understanding this correctly THIS TIME

flat nymph
#

yes

#

like mutex is a lock which blocks the threads that haven't been able to acquire it

surreal path
#

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

flat nymph
#

forget about futex

#

for now

surreal path
#

okay so im guessing im wrong

#

fun

#

then how is mutex impl'd?

#

how is it shared between threads

#

how does it work

flat nymph
#

You want mutex for uACPI, right?

surreal path
#

yea

flat nymph
#

Not for userspace

surreal path
#

yea

flat nymph
#

I'm lost

flat nymph
#

Same as spinlock, but with ability to block threads

#

(btw spinlocks can also have lists trl)

surreal path
#

bro stop making this more complicated

flat nymph
#

That's what I was trying to explain the other day

surreal path
#

is mutex a structure that has a lock and a waitable hdr which contains shit like blocked threads yes or no

flat nymph
#

The simple impl is C struct mutex { spinlock lock; bool acquired; thread_t list_of_blocked_threads; }

surreal path
#

thanks

thorny glen
#

If you're in a context where you can yield then you should just use a blocking mutex

flat nymph
#

I disagree?

thorny glen
#

Why

flat nymph
#

blocking is much slower than yielding

thorny glen
#

Priorities

flat nymph
#

still, there are cases where spinlocks are preferable