#EvalynOS

1 messages Ā· Page 19 of 1

hazy saddle
cold barn
#

that's kinda dumb for a DSL though if your kernel is expected to have lots of modules

peak cloak
cold barn
#

if not, then that's fine, just use a checkbox

peak cloak
hazy saddle
#

I want to get a module loader for my kernel at one point

peak cloak
#

theyre pretty much obligatory

hazy saddle
#

Especially for something like XHCI

cold barn
#

why?

peak cloak
hazy saddle
# cold barn why?

Idk just would be cooler? And if I support reloading could make testing easier depending on the environment

#
  • it would be good if you don’t need the USB module enabled etc etc
cold barn
hazy saddle
cold barn
#

and/or have a kernel option to disable it

hazy saddle
#

But like tiny code sizes

#

I mean it would also be fun to get modules working anyways

cold barn
#

make it a build time thing then

#

I mean yeah, that's fine

#

but there's probably no technical reason why you need/want modules

hazy saddle
#

Yeah

peak cloak
#

i only want modules for fonts rn

#

i dont want to have a built in font idk why

hazy saddle
cold barn
#

just embed one and then load the others using a userspace interface?

cold barn
#

ok then wait until userspace to load one then

hazy saddle
peak cloak
hazy saddle
#

fonts.ko

cold barn
#

in terms of like, booting at least
it should basically just:
execute /init//sbin/init//bin/init or whatever

peak cloak
hazy saddle
#

Plus parsing elf files it’s given etc?

cold barn
#

yeah but that interaction is prompted by userspace

hazy saddle
#

Though a font.psf being auto loaded isn’t too bad

#

Epically if you don’t want to embed a font

#

I do agree Userspace doing it is better though

cold barn
peak cloak
#

psf is tolerable

#

i might use it

cold barn
#

so you just specify the path on the commandline, or in the bootloader config, and load it as a pseudo-module

#

or ttf, or bitmap, or whatever

hazy saddle
#

I also should port UACPI soon trl

peak cloak
#

and i dont need acpi trl

hazy saddle
#

I want to do my heap rewrites though

#

Before that*

cold barn
#

do it

#

wait werent you supposed to be going to bed

peak cloak
hazy saddle
#

I was just finishing up my commit and got distracted here

#

It’s not too strict

#

Crappy ATT router please let NAT loopback work properly so I can commit šŸ’€

peak cloak
#

at&t routers suck

#

one died in a thunderstorm and the other one just bricked itself

#

im typing from a hotspot

#

were just getting an actual expensive router instead trl

cold barn
peak cloak
#

wait what

cold barn
#

unless the problem you're testing only occurs on hardware, then it becomes a little harder to do that but not impossible

peak cloak
#

connect it to The Wall(TM)

hazy saddle
#

And I CBA to setup wire guard in my laptop when a few attempts makes it go through

#

And it’s my grandmas house

#

And the router makes you use it anyways with passthrough mode

#

My clothes get out of the dryer in half an hours

#

So I should stay up til then to take a shower

cold barn
#

just edit your /etc/hosts to point git.evalyngoemer.com to 192.168.deez.nuts

peak cloak
#

base36 ipv4 addresses

#

ipv4-36 trl

peak cloak
#

oops wrong thread

hazy saddle
#

Yes

#

Also technically if I’m using mlibc and toybox would my OS be mlibc/toybox/evalynOS?

#

Since the kernel will of course support any userspace you throw at it

#

Just that I have a designed one in tree etc

peak cloak
#

borscht/evalynOS trl

hazy saddle
#

That’s part of the built system not a core component of the running system

hazy saddle
#

In Lua

peak cloak
#

LAU

#

911, can you get mao zedong on the line

#

also will this support 32 bit ever trl

hazy saddle
#

This one no

#

Maybe later tho

#

Il make a 32 bit branch

cold barn
#

why lua, specifically?

#

bash is a pretty common choice for a source package manager

peak cloak
#

because lua is based

severe marlin
#

Bash is meh for a package manager imo, lua is cool

peak cloak
#

id rather make one in C

#

like a real based person

hazy saddle
cold barn
#

true but I think it would also make you a LOT more comfortable with bash scripts

hazy saddle
#

Trueeee

#

Though Lua would be easy to embed into the binary that would handle things

#

& could defer logic to it easier?

cold barn
#

wdym embed into the binary?

hazy saddle
#

Like having C code as the main part of the manager and having Lua embedded like you do with a game engine etc

#

I am about to sleep now

#

I am all tucked into bed

#

Good night :3

cold barn
#

gn!

hazy saddle
#

Ahh the good ol waking up at 4/5 am lmfao

#

I wonder if I should do the VFS work or keep working on the port if PCC is wanting to do it. Or I could do the lock free heap rewrite which could be fun

cold barn
hazy saddle
#

ended up testing on some more PCs and had to patch my seriel port driver heh

hazy saddle
#

Why 3:

peak cloak
hazy saddle
#

The seriel port on the desktop wasn’t being init right

#

So I had to slap on some io waits to slow it down enough :p

peak cloak
#

yeah i see

hazy saddle
peak cloak
#

IO abuse

#

i need wifi router BAD

hazy saddle
#

I mean it’s pretty standard practice

#

The Linux kernel uses IO waits too

peak cloak
hazy saddle
#

The device just is too slow to keep up with my configurations of it

peak cloak
hazy saddle
#

So I slow it down by like 10 micro seconds for every write

hazy saddle
#

I even use it here if the ACPI timer reads zero to add a little delay before checking it again

#

Ahh I think my code ordering there is bad lol

peak cloak
#

RIP

#

man why do elf binaries make sense

#

anyway

hazy saddle
#

It shouldn’t hurt anything because it will fall back after that

#

But I should fix it :p

hazy saddle
#

Yes

peak cloak
#

woh

#

why

hazy saddle
#

For timing things

peak cloak
#

uhhh kay

wanton grove
hazy saddle
#

It’s just a device that’s part of the specs

peak cloak
#

fair

#

shameless open fartware ripoff

#

shame unto thee intel

cold barn
#
if git apply --reverse --check ${PATCHES}/mlibc-evalynos.patch; then
    git apply --reverse ${PATCHES}/mlibc-evalynos.patch                                                                                     fi```
hazy saddle
cold barn
#

ah

peak cloak
#

what does reverse application even do

cold barn
#

it undoes the patch

#

I feel like that's pretty obvious šŸ’€

coarse oasis
#

git unapply

peak cloak
#

applies it in reverse

#

go from the last patch to the first one trl

cold barn
#

...yes

#

that's the same thing

peak cloak
#

no it starts at the end of the file instead of the start of the file when applying it trl

#

you said it undoes the patch

cold barn
#

yes that's the same thing

peak cloak
#

yes

cold barn
#

it starts at the end of the patch and the end of the file, and works backwards

#

I know you're trying to be funny but you're explaining it correctly

cold barn
peak cloak
#

bruh why are my jokes actual reality now

#

whats next, gcc age verification??

cold barn
#

don't give them ideas!!!

peak cloak
cold barn
#

wtf is wrong with you šŸ˜”

peak cloak
#

i also made one about bash scripts requiring you to be over 18 šŸ˜”

#

we're cooked nooo

hazy saddle
peak cloak
peak cloak
cold barn
#

...to undo a patch? you realize not all patch are applied to a VCS tree right?

cold barn
#

working backwards = undoing what you did

peak cloak
#

oh

#

no i just meant that it goes from the end of the file and goes backwards while parsing and applying the actual patch it doesnt undo it nooo

#

im not sure if we're talking about the joke reverse patching or actual reverse patching

#

if actual reverse patching then yes i understand how someone would need that

hazy saddle
#

Top to bottom or bottom to top should apply a patch the same

peak cloak
peak cloak
#

its a fix

#

it fixes

hazy saddle
#

At some point I may make outb and inb do an iowait automatically tbh

peak cloak
cold barn
#

what the fuck why

#

that's really weird

peak cloak
#

it looks normal to me

hazy saddle
peak cloak
hazy saddle
peak cloak
hazy saddle
peak cloak
hazy saddle
#

That’s still slower than an iowait which costs a few useconds

peak cloak
#

true

#

wait @hazy saddle you can actually put an io_wait at the end of the outb's and inb's, like in the function itself

#

unironically

#

its gonna be slightly slower but no one is gonna die from this crap imo

hazy saddle
#

And I already said that lmfao

peak cloak
#

oh

#
void outb(uint16_t port, uint8_t sendWhat) {
  // ASM routine
  io_wait():
}

i mean something like that

hazy saddle
#

Just that would take more of a rework than I wana do rn

cold barn
hazy saddle
#

Esp when your not touching that part of the code too often

hazy saddle
#

Il put that on my todo during the code cleanup

#

Or I could do it rn

#

To procrastinate

peak cloak
#

bruh just open the function and paste a slab of code in there

#

why yall like waiting for rewrites so much nooo

hazy saddle
#

Yeah but I have to remove the IO waits elsewhere :p

peak cloak
#

oh

#

then do it

#

-# incoming send patches sticker trl

#

@hazy saddle run a ctrl+r to replace all the io_wait's with spaces everywhere except the IO file itself trl

hazy saddle
#

I’m the one who sends it to you

#

@peak cloak

peak cloak
hazy saddle
#

I’m gonna do it anyways it’s fine lol

peak cloak
#

oh ok

hazy saddle
#

Also some IO waits are seperate lol

#

And still needs

peak cloak
#

cant send patches no more nooo

#

my talk is quite expensive now

hazy saddle
#
#

Look at what I just ordered :3

#

I’m gonna be implementing a GDB stub for my kernel

#

And I now have the proper serial ports for it

#

Also I may or may not make my GDB stub very portable if I can help it (for x86-64)

hazy saddle
#

I think I’m also gonna embed a serial port driver into this & have an option to have it be integrated into yours and or use a specified port

#

You will need to define ways to access random any physical memory & virtual memory (so you can do fancy stuff and handling if desired)

#

I will also need a way to hook onto your process system so I will have commands to give an ID to enable a breakpoint for and your kernel can check for that & send commands to let it know it should enable or disable breakpoints

#

Maybe better solutions that that tho

#

Or just not support userspace debugging PSP1G_pspTrollar

hazy saddle
hazy saddle
#

Crap I need to do actual work today

#

Il finish that stupid outb rework in a moment

#

And then maybe work on my VFS

hazy saddle
#

okay so i have these functions

#

ones that are "standard"

#

and ones with intehrated delay

#

to make things cleaner

#

why two you ask?

#

because its safer

#

@cold barn and @peak cloak what do ya think

cold barn
#

it's terrible, you should throw it away immediately and switch to web dev /s

hazy saddle
#

ngl i think webdev is harder than osdev :p

cold barn
#

it looks much cleaner

cold barn
hazy saddle
#

i mean for me personaly atleast

#

my brain cannot wrap arround it well

cold barn
#

modern web dev is, but that's because it's so new nobody has figured it out yet :)

hazy saddle
#

trueee

#

Btw is that script going well? Btw what games were you playing

#

Anything new come out that’s good

cold barn
#

and yeah, I think i have it 99% there I'm just trying to get patch to not kill itself

hazy saddle
#

Loll

#

LMK if you want me to regenerate the patches in a cleaner way btw

#

If it’s possible

cold barn
#

I see why you did || true now, I could've sworn there was an option to silence it

#

OH

#

I remember how I solved this last time

#

(I also got it basically done yesterday, but didn't switch to dev so I restarted today)

hazy saddle
#

Ahh dang

#

What was it if I may ask

cold barn
#

you just [ -n "$NOCLEAN" ] && rm -rf <sources>

hazy saddle
#

Huh cool

#

Also I wonder about storing a hash of the patch file to know when to rebuild each complement?

hazy saddle
#

this fixes it @cold barn šŸ’€

#

ya know what just to be safe trl

cold barn
#

why not make them macros?

cold barn
#

I also parallelized the extraction

#

might do the same with the download

hazy saddle
clear bison
cold barn
clear bison
#

always_inline attribute smh

hazy saddle
cold barn
#

doing it for performance isn't necessary here, yeah, but I just prefer to have the actual code inserted there if that's effectively what i want

hazy saddle
#

I like the compiler to do its thing for the most part and leave macros to more advanced things liket DBG_LOG

#

Also I keep seeing online ā€œyou don’t need IO waits on modern hardwareā€

#

Well clearly ya do :p

#

This 12th gen intel system clearly is being very picky about it

#

fuck you mean this breaks it?????

#

this is a pretty standard seriel setup right?

#

maybe it will like this better?

#

Nope

#

Why the hell is this so picky about the io waits

#

@cold barn I’m just gonna call it a hardware problem and not support that devices stupid serial port ;p this thing works fine on every other device I’ve tested it on

cold barn
#

yeah that's reasonable

#

guess you could also look at the *BSD code, if you can test that on the hardware

hazy saddle
#

True true

hazy saddle
cold barn
#

which BSD is that? Open? Net?

hazy saddle
#

openbsd

cold barn
#

hmm I think open

#

yeah

hazy saddle
#

the fuck?

#

my kernel locked up on the othrtr laptop doing nothin???

#

thats never happened under no load\

cold barn
#
./dev/acpi/pluart_acpi.c
./dev/fdt/amluart.c
./dev/fdt/cduart.c
./dev/fdt/exuart.c
./dev/fdt/exuartreg.h
./dev/fdt/imxuart.c
./dev/fdt/imxuartreg.h
./dev/fdt/mvuart.c
./dev/fdt/pluart_fdt.c
./dev/ic/pluart.c
./dev/ic/pluartvar.h```
try one of these?
hazy saddle
#

lookin

cold barn
#

sys/dev/ic/com.c is it, actually I believe

#
/*
 * COM driver, based on HP dca driver
 * uses National Semiconductor NS16450/NS16550AF UART
 */``` :)
hazy saddle
#

ooo ty ty

#

it looks alot more complex

#

what if i just goto the wiki andddd

cold barn
#

alright we'll see if this works šŸ˜‚
-# <attachment removed>

#

running it rn

#

last time it said during mlibc configuration that evalynos wasn't supported

#

ah that's why

#

wrong path to the patch

#

oops I forgot a .. XD

hazy saddle
#

hm it seems i am not follwong specs

#

that bit iirc

#

i dont clear DLAB right away

#

which may be causing the funky?

#

let me extract these info functions more like the BSD implementation

cold barn
#

WHOAH

#

okjay

#

god damimt

#

it's git apply being dumb and slightly misleading

#

wellll so far it works šŸ˜‚ other than that same error as last time make[4]: *** No rule to make target '../../ld/scripttempl/.sc', needed by 'eelf_x86_64_evalynos.c'. Stop.

#

(@hazy saddle)

hazy saddle
#

ooooo

#

let me test this

#

im reworking the seriel driver

#

making it alot less jank

#

i may have been clobbering a bunch o' shit pain

cold barn
# cold barn

almost half the size of the previous script :)

#

and way faster :P

#

I did end up parallelizing the download as well as the extraction

hazy saddle
#

whats MPFR and MPC?

cold barn
#

obv can't do much more than that

#

libraries gcc needs to build

#

they may not be available on the host, so that adds them

hazy saddle
#

ahhh cool

cold barn
#

it'll statically link them into gcc

hazy saddle
#

way better @cold barn \

#

well time to test

#

it works in QEMU

cold barn
hazy saddle
#

And it fucking works!

#

And it broke with no changes and a reboot

#

Wait a darn moment

#

Let me test somthing

#

I’m going to send 5 test bytes

#

And check them all

#

Just to be safe

#

Two for two working

#

Three for three let’s fucking go

hazy saddle
#

found a bug with my DLAB and wana test one last time

#

was setting bit O and not 7

#

@cold barn huh?

cold barn
#

uhhhh

hazy saddle
#

maybe it diddnt like i was in the root folder

cold barn
#

ah

#

correct

hazy saddle
#

add this?

START_PATH="$(pwd)"
if [[ "$(basename "$PWD")" != "libc" ]]; then
    cd ./src/libc || { echo "./src/libc folder dosnt exist? Did you download the repo correctly? Are you in the project root directory?"; exit 1; }
fi

# at the end
cd $START_PATH
#

Or do you got a better way

cold barn
#

I would rather say "run the script from the dir"

hazy saddle
#

True but it makes it more idiot proof imo?

cold barn
#

and have a ./build.sh to run that one

hazy saddle
#

I could hook it into my build system and have it automatic

#

Let me test it with my patch and then I will throw it into the build system

cold barn
#

what's your current build system?

hazy saddle
cold barn
#

ah ok

hazy saddle
#

I want to switch to meson at some point but this system isn’t too bad right now so :p

cold barn
#

so, I might be able to help convert it to an actual makefile build system if you don't plan on supporting modules

#

if you do, I wouldn't recommend makefiles since it gets a little messier (not inherently because of the modules but because scope creep starts to become an issue with the build system)

hazy saddle
#

I do plan to support them at some point. I do wonder how it would look like with it being a real makefile build system though

cold barn
#

you'd have to abuse the hell out of gnu make

#

or switch to (my beloved) bsd make, and make people install bmake on !BSD (aka linux) systems

#

thankfully it's packaged pretty widely

hazy saddle
#

Honestly sticking with makefiles would be nice because it does get annoying to manually add things to the list lol but I guess the reason for that in meson is the speed

#

@cold barn it works!

#

but it seems to rebuild the entire thing every run?

cold barn
#

thanks!

#

yes that's somewhat intentional, if you do NOCLEAN=1 (or any value other than empty/unset) it will not remove the build dirs, though it will reconfigure so it might still rebuild some stuff

hazy saddle
#

So it would say still build mlibc on patch changes?

cold barn
#

uhhh

#

I think you would have to un-apply the patch?

#

hmm, I'll think on this some

hazy saddle
#

Oh yeah that’s gonna be a bit annoying too because mlibc is a sub module and my IDE keeps showing it as changed trl

rancid viper
#

is there a reason why you arent using something like jinx or xbstrap

hazy saddle
#

Which is why I considered hashing the patch files and only triggering rebuild when that changes and unappplying the mlibc patches after

hazy saddle
hazy saddle
#

but i mean a bash script isnt too bad and easier for people to run no?

rancid viper
#

in the case of jinx not really

#

jinx is a bash script

hazy saddle
#

huh

rancid viper
#

literally the entire thing is a bash script

#

though it does compile a c that is here-filed into the script iirc

#

and some other slightly cursed things

hazy saddle
#

Huh interesting

#

Can I see the repo?

#

A Google search came up dry

rancid viper
hazy saddle
#

Huh looks pretty cool

#

Maybe for my build system rewrite

#

@cold barn i think its all ready for now. thew this at the top and the commit will be "improve build-libc.sh by PCC"

#

That good?

cold barn
#

I would do it differently, one sec

hazy saddle
#

that and these are my twaks btw

cold barn
#

yeah there is no need for START_PATH

hazy saddle
#

I can just do a push at the top and a pop at the bottom I presume?

cold barn
#

you don't even need to do that if you're not sourcing the file

#

it gets run in a subshell with ./build-libc.sh

hazy saddle
#

Wait huh

#

So I only need the check and the cd?

cold barn
#

you just need a cd "$(dirname -- "$0")" at the top to cd to the directory that the script is in

#

you'll get put back in your directory when the script exits

cold barn
#

oh, and reverse applying the patch I don't think is necessary? I'm not exactly sure

#

you MIGHT be able to just apply the patch on top of it

#

although, you may just want to re-init the submodule every (NOCLEAN=1) build, or just use a tarball

hazy saddle
#

i need it for my IDE to not yell at me to commit the sub module anyways wahhgone wahhgone

cold barn
#

not necessarily a release tarball, but a tarball

hazy saddle
#

Yeah I’m probably gonna swap everything to tarballs away from sub modules

#

They are a PITA PSP1G_pspTrollar

#

I guess it’s time to reattempt bash & toybox?

#

Now that the build script isn’t total dookie wahhgone

hazy saddle
cold barn
#

well, if you de-init and re-init :)

cold barn
#

but yeah that did improve it

cold barn
#

you're trying to idiot-proof it instead of telling people they're idiots :)

hazy saddle
hazy saddle
#

And tarballs should work quite nicely

cold barn
#

and can you upload a tarball of your binutils build dir too?

#

including objs and logs and all

hazy saddle
#

Il zip up both the sysroot and toolchain folders

cold barn
#

I wanna compare

hazy saddle
#

Want me to do the entire libc folder?

#

That should have it all

#

may take a moment

cold barn
#

OH

#

and can you make sure this is from a clean tree using my script

hazy saddle
#

@cold barn I wonder what part is it crashing on?

hazy saddle
#

Wait what make are you using?

cold barn
#

gnu

hazy saddle
#

Hm hmmCat

cold barn
#
# make --version
GNU Make 4.4.1
Built for x86_64-unknown-linux-musl
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.```
hazy saddle
#

Maybe the port master knows what tf is up with that?

#

Oh there is something you can try actualy

cold barn
#

sh is dash?

#

guess I'll switch that to bash

hazy saddle
#

You can use this to get arch Linux

#

Given you are on another Linux distro

hazy saddle
cold barn
#

I probably can't use that since I'm on WSL1, but I'll make an arch chroot

hazy saddle
#

WSL2 may work better

cold barn
#

I can't use it

hazy saddle
#

That uses a more standard VM

#

Ahh damn

cold barn
#

I know

hazy saddle
#

Sorry

cold barn
#

I have other software (virtualbox) that needs the virtualization capabilities

#

its ok lol, not your fault

hazy saddle
#

Could make a full Linux VM inside there PSP1G_pspTrollar

cold barn
#

nah a chroot should work

hazy saddle
#

šŸ¤ž

#

@cold barn crap i forgot to switch to dev branch

#

rebuilding

#

time to reset the counter

cold barn
#

god damn arch is a pain in the ass to bootstrap

hazy saddle
#

@cold barn zipping up now

hazy saddle
#

it really helps get things started

cold barn
#

yeah I figured that out eventually

#

I was trying to use pacstrap/pacman and it's IMPOSSIBLE to get the gpg signing on everything to work

hazy saddle
#

crap i dont have my file server password on my laptop

#

šŸ’€

#

i can manualy copy i with a USB there

#

just may take a bit longer

cold barn
#

šŸ’€ no ssh keys?

hazy saddle
#

oh true i can just do that

cold barn
#

I literally just replicate an encrypted tarball of my ssh keys on basically every machine lol

#

need to log in from a new machine? sftp into one (with password), decrypt into /tmp, transfer, delete /tmp file tf

hazy saddle
#

i just manualy copy the keys over

#

and i have a public key on my domain name to pull easy

#

copying it over

#

copyparty may allow you to download while i upload but it may now support it with me using sftp @cold barn

cold barn
#

I'll just wait until it's done

cold barn
#

btw zstd tends to have a better ratio of compression to creation/extraction speed compared to gzip or xz

hazy saddle
#

I wonder if I can add that to the default on my KDE menu?

#

also I’m going to sleep now

#

Have a good [[timezone]]

cunning oracleBOT
cold barn
#

goodnight!

cold barn
#

yeah building it under arch works

#

idfk

cold barn
#

OMG @hazy saddle I think I figured out a way to continue using submodules (my beloved ā¤ļø) without having to fuck around with them

#

just fork any that you need to modify, do the modifications there, and vendor the latest change in your evalynos repo

#

I was seriously not thinking about it that hard since I tend to just not need submodules šŸ˜‚

#

but yeah right now I'm just working on getting evalynos built inside arch

#

I might eventually take a look at your patches to figure out where the fuck the arch-dependency is happening

if you don't get to it first :)

hazy saddle
#

Il do a poll for this a bit later I think

hazy saddle
#

I will also test WSL on my grandmas computer for this

hazy saddle
#

@cold barn compiled just fine on alpine Linux edge with a minor change because OVMF paths

#

Crap I am on master wahhgone

#

I thought I did the command

#

I did git branch and then checkout

#

So it must of broke shit

#

But it was your script file PCC

#

It is gonna have to be WSL2 but I’m gonna test it on Debian there

hazy saddle
#

Oh shit KVM works under WSL2???

#

Let me just do a bit more testing as I still need to make the toolchain

#

And it’s a bit picky about audio server and XDG

#

But it’s booting

hazy saddle
#

@cold barn I don’t know if this is viable for your setup but everything works perfectly under Debian WSL2 and your script on the proper dev branch. I’m even using KVM

#

But if everything works for me on 3 machines running diffrent environments

#

Somthing may be going badly on your end

#

I am honestly shocked at how good this works

#

I just had to relogin and add the group

#

And all issues went away

#

Props to the NT kernel team and whoever did the userspace bits of WSL

#

This is very good

#

Now make the rest of the userspace good

cyan bison
#

WSL2 is just linux VM

hazy saddle
#

Well yes

#

But I’m surprised that it can do nested VMs properly

#

And open GUI crap

#

Etc etc

wooden maple
#

WSL1 was cooler

cold barn
cold barn
hazy saddle
cold barn
cold barn
hazy saddle
#

I could have it part of my get deps script

#

I don’t like binary files in there

cold barn
hazy saddle
#

Ahh lol

#

Also my USB to serial cable is here

#

Bus 001 Device 016: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

hazy saddle
#

it works :O

#

after a few correctess tweaks

#

tho i think i need to swap the flanterm locks to not disable IRQs

#

and possibly use a kthread for it PSP1G_pspTrollar

#

that way printf goes into a buffer

#

& that will flush it

#

maybe same for serial?

#

though thats much less intensive of a task so its fine

#

i wonder what linux does here

soft snow
#

I'm so confused

hazy saddle
#

On real hardware now

soft snow
#

Fire

hazy saddle
#

I’m gonna clean it up a bit more

#

As it’s a lot of magic numbers

#

And I should abstract things a bittt more

#

But it should be all good after than and be ā€œperfectā€

hazy saddle
#

magic number b gone

hazy saddle
#

It used to be a copy of the one from the wiki almost mmLol

#

Which well is not exactly the best for real hardware and it being extendable

#

I’ve split everything out into functions etc to make it all nice and easy to work with

#

If I ever get termios etc to set baud rates etc etc etc

#

What’s good is I now have an Intel and an AMD machine with hardware serial ports

#

Which means any issue I have should be solvable on these if it’s a CPU feature crash / issue

#

And I should be able to help others etc

#

Only issue is they live at separate houses

hazy saddle
#

@cold barn I’m about to go to sleep

#

Did you ever manage to get it to build right lol

cold barn
#

yeah I need to do homework and shit though so I gotta lock in before I do anything else

#

I also got "distracted" with other obligations for most of today tbh

hazy saddle
#

Understandable

#

Good luck on the homework o7

hazy saddle
#

Of course Amazon fucking delays the bracket by two days :p

#

After the window of me being able to reorder it for same day

#

So now I have to stay here at this house and wait for overnight shipping

fiery tangle
hazy saddle
fiery tangle
hazy saddle
#

This thing

hazy saddle
#

i got the thing in there

peak cloak
hazy saddle
#

@peak cloak okay i was jokin

#

but i had to remove my gpu

#

šŸ’€

#

shit was scary because i couldnt find the release

#

and i popped it out half way

#

the serial is working

#

but the driver failed once

peak cloak
peak cloak
hazy saddle
#

maybe i will do several self test methods if one fails

#

ther is a scratch register i can use to test

#

yeah there is a register on the serial controller that gives you a byte of memory

peak cloak
#

make sure you dont write to the CPU_SELFDESTRUCT register meme

hazy saddle
#

no ofc not

#

just the serial self test failed

peak cloak
#

(you bend 15 cpu pins or more)

hazy saddle
#

GDB stub time

#

I will have two modes for SMP

#

One for latching onto a core

#

And one for latching onto a thread

#

You will of course need a lot of kernel support

#

For sending IPIs etc

#

And if a core has IF=0 and the serial port is on there well

#

Not much I can do about it

#

If your having issues you can always dedicate a core :p

#

I will include serial drivers for this

#

But I will support generic TX/RX layers

#

So you can use UDP with this or whatever else etc

hazy saddle
#

Oh sick QEMU lets me use the physical serial port as the backend

#

So I can work on it really nicely

#

i think i may have to use polling on the serial driver?

#

if i am in a #DB context i dont want other IRQs

hazy saddle
#

Okay so

#

I am connected

#

I think it’s going okay?

#

But

#

I think it’s tweaking out

#

It locks GDB into an infinite loop

#

I am only sending an empty packet to everything but

#

The fuck is wait exit enter?

#

i also stop getting any packets or data?

#

yeah i am getting the same packets

#

i get nothing after

sterile plank
hazy saddle
#

i mean i should prolly like

#

implement some

sterile plank
#

i wanna make a joke

#

have you tried debugging it?

hazy saddle
#

you know whats cursed

#

about how im doing this btw

sterile plank
#

tell me

hazy saddle
#

i have the VM connected to my physical serial port

#

thats connected to my usb adapeter

#

and im pointer gdb to the usb adapter

sterile plank
#

Oh great heavens

hazy saddle
#

all on the same machine

hazy saddle
#

@sterile plank progress!

sterile plank
#

deltarune

hazy saddle
#

Yes I’m listening to deltarune theory while osdeving

sterile plank
#

now listen to osdev theories while deltaruning

hazy saddle
#

I now have to implement the register packets

#

So I’m going to have to add the right callbacks for debug and breakpoints

#

So when it gets one of those

#

It will capture it and then spin loop waiting for more GDB stuff

#

So it will have to nest interupts

#

Which is supported I think

#

Or maybe I don’t need that

#

No I will but

#

Okay yeah this will work

#

In the exception

#

It will store a pointer to the stack with all of the register state

#

So then when GDB packets come in

#

It can modify and read those

sterile plank
#

I wish you best of lucks :pp

hazy saddle
#

Then when that exists and the interrupt is popped

sterile plank
#

i havent been osdeving for a long time

hazy saddle
#

Then the #DB will return and have the new register information

hazy saddle
hazy saddle
#

Using atomic etc because this crosses context boundary’s

hazy saddle
sterile plank
#

i have no idea

hazy saddle
#

im just talking into the void of my thought process

hazy saddle
#

@sterile plank

#

It’s coming along well

#

I wonder if I could support reloading the kernel over serial

#

Like it would allocate the memory needed to put a new image there

#

And load a trompolihe

#

Get the new image over serial

#

And then reload the kernel using LBP

#

Reusing all the info I got earlier

hazy saddle
#

I still need to add single step crap

#

Because rn GDP always is returned the one thing

hazy saddle
#

chat my schedular may be fucked

#

Okay well good news bad news

#

Good news

#

The debugger works

#

Kind of

#

Bad news

#

It gets trapped inside that loop

#

And won’t debug anything else

#

Somthing seems to be saving and restoring that context there

#

And switching to it

#

Which

#

May be the first thread?

#

It could be that

#

Because then it gets first launched to

#

Yeah yeah

#

Not sure the proper way to solve that right now

#

and well somthing switches to it

#

but it dosnt sleep nice

#

or it does idk i cant read cpuusage well

#

but it acts like the idle thread

#

then the debugger gets trapped there

#

okay yeah

#

the first thread spawned

#

gets clobbered

#

which isnt an issue

#

because i can just spawn idle thread first

#

and then it gets clobbered

#

with what basicaly is an idle thread

#

this is what it looks like when its stuck

#

i think i just need the schedular to unset & set the TF on any returns from the preemption

#

eg here

#

Then this way when going into any context after a preemption

#

It can properly enable and disable TF

#

If task switching to needs debugging
Enable TF
Else
Disable TF

#

Also @peak cloak I’m gonna add borscht PSP1G_pspTrollar

#

Because I’m gonna make this configurable

#

As a lot of this may be dead code

#

So having it configurable will be good for performance

#

With all the extra branches

peak cloak
#

good luck finding instruction manual meme

#

tell me also if you cant understand it i want people to actually be able to read it

#

also use version 2.0c if you dont want to kill yourself

hazy saddle
hazy saddle
peak cloak
hazy saddle
#

Why do you even feel the need to do backports lmfao

peak cloak
hazy saddle
peak cloak
#

its literally all bugfixes to 1.0 anyway

#

so 2.0 is the only actual update meme

#

the backport was kinda important anyway, if it was a bug id leave it alone but it literally is so bad that make won't read your makefile properly

hazy saddle
peak cloak
#

its also here

#

still no GREGloader commit meme

hazy saddle
#

Thank you

#

This will be kool

peak cloak
#

kallegedly

#

KDE allegation tool

peak cloak
#

anyways tell me if it explodes somehow

#

the documentation is quite indeed utterly confusing meme

hazy saddle
#

Nah it’s not that bad

peak cloak
#

ohok

hazy saddle
#

Il have a make target that will download and compile it

#

And then let you use it

#

Otherwise it will use default options PSP1G_pspTrollar

peak cloak
#

download it and compile it pain

#

genuine insanity

#

and then i break backwards compat /j

#

"Oh no!" you scream, as you literally can't compile your project

#

It's just like the XAPIC trl

peak cloak
#

not always but theres a risk meme

#

it works fine with configs that dont suck balls

hazy saddle
#

Pinning to commits

peak cloak
#

insane

#

but anyway im not breaking backwards compat frfr

peak cloak
hazy saddle
#

That’s what major versions are for

peak cloak
#

intel sucks balls, i thought they at least stood by backward compat

#

but no trl

peak cloak
hazy saddle
#

loveley

#

this breaks things

#

i have zero idea how this should work

hazy saddle
#

Ngl I may have to move this to a feature branch

#

And just do my VFS soon

#

But I’m really close to finishing this

#

Just lost

peak cloak
#

RIP

hazy saddle
#

Maybe when obberow is free he can help like he said

hazy saddle
#

Wait

#

What if it already has been working

hazy saddle
hazy saddle
#

Because I don’t have breakpoints yet

hazy saddle
#

Okay yeah it seems to just be breakpoints and them being broken

#

I have swapped serial to be an NMI

#

It does not like having a ā€œcliā€ inside of the #BP handler though

#

It got very corrupted

#

Though maybe I should setup ISTs

#

Well I should :p

hazy saddle
hazy saddle
#

So I’m gonna code in hbreak support for GDB

#

Not sure how to tackle software ones for this :p

#

Hopefully it won’t break badly?

#

Because with the manual break it kept trapping on the same one after running s

#

Maybe that’s just some other issue

#

But it is working almost

hazy saddle
#

Well I hope that still means I can fuck with the frame that gets restored on IRETQ

#

Also instead of a CLI il swap up some handling to not set sti earlier etc

peak cloak
#

fair

#

crap aint i supposed to sleep

hazy saddle
#

No that’s me :p

peak cloak
hazy saddle
#

Amazing

#

I woke up

#

It’s now randomly not working

#

Even after undoing changes

#

It’s just fucking packet overflowing constantly

#

I am going to have to scrap this all

#

Aren’t I

#

and restart

hazy saddle
#

I have an idea!

#

IRQLs

#

This way everything can be masked except serial

#

Which means I don’t have to mess with cli/sti

#

And messing things up

#

Which means things can be dealt with cleanly

hazy saddle
#

IRQLs suck

#

They make my kernel run doom at 1 frame per 7 seconds

#

Atleast during the fireworks test

#

Before it could atleast somewhat be playable

hazy saddle
#

CC: @urban vale I would like to ask if you have any idea what’s causing this wahhgone

#

wait

#

guess who was using cli/sti still

#

:p

#

i fixed it

#

now IRQLs work

fiery tangle
hazy saddle
#

I am doing it the lazy way

#

Without CPU local

#

So I won’t be able to emulate it on other architectures

#

Sadly

#

But that’s a problem for future me

hazy saddle
#

But now I can properly make serial have super high priority

#

And then raise to the level below it

#

So only serial can interupt me

#

I also could just not use IRQLs on CPUs lacking support

#

And fallback to other methods

#

Because for most things I’m not using them fully

#

Sooooo I can use a few ifdefs here and there

#

Or arch spesific abstractions

#

oh btw all my IRQLs are at IRQL2

#

so im not sure if anything is breaking

#

wait i can test this

#

this seems to work

#

wait a second

#

i can use a lookup table for IRQ to IRQL translations

#

oh and thats bad because i shouldnt change IRQL on exceptions

#

nvm i already handle that

hazy saddle
#

That’s not how IRQLs work

#

😭

clear bison
#

After looking at IRQLs I can't believe i just reinvented them in my previous kernel KEKW

hazy saddle
#

Lmfaoo

#

They are pretty cool

#

And it’s gonna let me implement my debugger

#

Without having a ton of issues

#

Since it will be able to preempt everything

#

Even when spinlocked etc

hazy saddle
#

With like properly setting the vector

kindred stirrup
hazy saddle
#

My fireworks spawns a shit ton of hello worlds

#

In a batched way

#

It was because I still had spinlocks setting cli and sti

#

Through the schedules

#

Because it uses a different unlock function

kindred stirrup
#

They should instead raise IRQL

hazy saddle
#

Well yes

#

My inline functions for spinlocks that everyone use did that

#

But the schedular has a special unlock function

#

Where assembly can call it

#

Which I forgot to update

#

Fixing that makes it run smoothly

fiery tangle
hazy saddle
#

No vector as in interupt

#

I am bad with names so I call them vectors

#

Instead of interupts

#

Also because I can’t spell

kindred stirrup
#

"Interrupt vector" is an actual technical term

#

The x86 real mode interrupt dispatch table is called IVT