#EvalynOS

1 messages · Page 17 of 1

wanton grove
#

give

hazy saddle
#

Drop this in the folder in /src/initramfs

#

And unzip etc

#

Should work

#

Uhhhhh

#

In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it. The term is a pun on the name of Werner Heisenberg, the physicist who first introduced the uncertainty principle, and it is a reference to the observer effect, which states that the act of observing a system ...

wanton grove
#

how to make this error

hazy saddle
#

Well nobody can reproduce the faults anymore

#

💀

#

But

#

I still have my buggy patch files

#

Which are other issues

#

the AM speech one is the latest

wanton grove
hazy saddle
#

Only one

#

The “FIREWORKS” test command is on those patches

#

And reproduces some strange ass faults

#

@rotund furnace May have more patches based on thoes fucks that caught more

#

crashes and the errors*

hazy saddle
wanton grove
#

i cloned this

hazy saddle
#

What does git status say

#

By default it clones master iirc

true oak
#

power of friendship

#

thats how you got fork

hazy saddle
#

I ain’t even forking yet

#

Or threeking

#

Or twoking

#

Or oneking

#

Or zeroking

true oak
#

i need a group like that too lmao

mortal bane
hazy saddle
#

99 little bugs in the code. Take one down, patch it around 117 little bugs in the code.

hazy saddle
#

thats klange?

cyan bison
#

#1141057599584878645 message

hazy saddle
#

i stole it from reddit

#

Does this mean

#

Kevin Lange

#

Is a Redditor

mortal bane
# hazy saddle

ayo what 😭 reminds me of clobbering the rcx and r11 during sysret

hazy saddle
#

I think I’ve got heap corruption

#

(Not mllibc)

#

I caught my kernel trying to use fucking user memory addresses for shit

#

And some null pointers

#

And the heap I have is known to be dookie 💀

mild glacier
#

they also forgot "and 25 errors in the code"

hazy saddle
#

Like deeply lmfao

#

Getting it to compile is easy

mild glacier
#

should i compile everything with -Werror 🤔
coz undefined references to functions are not errors for no reason

hazy saddle
rancid viper
#

Out of curiosity what does it yell at u

hazy saddle
mortal bane
hazy saddle
#

nope

mortal bane
#

just how 😭

hazy saddle
mortal bane
hazy saddle
mortal bane
#

do you use the -no-pie IN your ld flags?

mortal bane
hazy saddle
#

same thing

mortal bane
#

more then 2GB

hazy saddle
#

idfk

#

it shoudlnt really ever be above 2gb anyways

mortal bane
#

you are calling functions more than 2GB far away

hazy saddle
#

the kernel is less than 2gb in size and it has to fit in the higher half

#

and if i were things would be fucking up bad

mortal bane
hazy saddle
hazy saddle
#

how tf to i get the build id to work

#

i need my builds to have this in them

#

so when shit fucks up i can tell what build etc

#

and i can see if it properly reflashes etc

mortal bane
#

try the large one -mcmodel=large

#

instead of kernel

#

its a linker warning

hazy saddle
#

thats coming out of NASM

hazy saddle
#

okay so

#

my kernel is fucked

#

BUT

#

its not over

#

im rewriting in C++

#

with @wanton grove joining maybe for some things

cyan bison
hazy saddle
#

im gonna get c++ flanterm and nanoprintf

#

and then get more stuff fixed

hazy saddle
#

we are also gonna do proper arch abstractions

#

and shit

cyan bison
#

c++ evil

hazy saddle
#

C++ ❤️

cyan bison
#

C++ 🤮

wanton grove
#

c++ ❤️

cyan bison
#

c++ 🤮

urban mulch
#

C-- trl

hazy saddle
#

i am using c++

#

and NOBODY can stop me

cyan bison
#

im adding a new clause to my license

#

no taking my code and putting it in c++ code

#

now u cant steal my allocator like u did before

hazy saddle
#

then i wont steal that allocator

cyan bison
#

u got me there

hazy saddle
#

ya know what

#

if you fix my kernel

#

i wont use C++

cyan bison
#

no

hazy saddle
#

then C++ it is

cyan bison
#

inb4 rewrite in 3 weeks or less

hazy saddle
#

i am doing a rewrite

cyan bison
#

no i mean another rewrite

hazy saddle
#

is that what i think it is?

#

c++?

hazy saddle
#

i still have some stuff to do

#

for inital commit

#

but its looking good

#

okay so for this revision

#

i am dropping support for old add machines

#

because im going to be implementing lock free agloritms

#

including for the PMM

#

oh also

#

im going for multi arch

#

x86_64 aarch64 and riscv-64

#

Things are going to be abstracted from the start

#

So I don’t shoot my self in the fucking foot

#

Again

#

im also gonna support MB2

peak cloak
#

nice tho

#

good luck

#

also grub specifically doesnt report the proper amount of memory when using the basic memory info function

#

limine is fine with it but grub aint

#

like under the mb2 protocol

hazy saddle
#

Hopefully this new version of the kernel

#

Won’t need rewrites

#

Because if it does

#

I’m doing it in rust

#

You hear that @cyan bison

urban mulch
hazy saddle
#

cc: @clear bison

peak cloak
#

multiboot3

cyan bison
clear bison
hazy saddle
#

this is what i got so far

#

gonna get the riscv and and arrch64 ports goin

clear bison
#

so you got a multiboot2 prekernel I'd guess

hazy saddle
#

i need a prekernel for it?

clear bison
#

i mean if you wanna start up with paging

#

and other stuff

hazy saddle
#

i mean i am possibly fine doing that inside my bootloader init stub?

clear bison
#

in mb2 you start in 32-bit pmode with no paging

hazy saddle
#

idk if i wana do this anymore

#

when mb3

clear bison
hazy saddle
#

nah nah i can do this

#

il have to make that part in assembly and c

clear bison
#

so I'd recommend you first get some preallocated area to have a stack

hazy saddle
#

and have it jump to my kmain

clear bison
#

btw are you going to go to lmode or stay in 32-bit pmode?

hazy saddle
#

im gonna be goin to long mode

clear bison
hazy saddle
#

yup

#

i will have to do a full pre kernel i think

clear bison
#

mine does in both x86-32 and x86-64 but eh, the 32-bit one is like 512mb

hazy saddle
#

i could actually support i686 with this then

peak cloak
#

i think you can support any 32 bit intel

#

unless you did i686 gcc

#

in which case you ARE lame

hazy saddle
#

im not doing i386

peak cloak
peak cloak
clear bison
#

nah i386 is kinda hell

#

if anything I'll only support i586 at a minimum

hazy saddle
#

i could do i585

peak cloak
#

pentium-1

clear bison
#

pentium mmx and shi

#

after booting an mb2 kernel you have an MBI (which is basically an small header + an array of information tags) which is placed in EBX, and in EAX you have the MB2 signature

hazy saddle
#

/home/evalyn/Documents/Programming/C++/evalynOSprime/kernel/deps/nanoprintf/nanoprintf.h:748:(.text.npf_vpprintf+0xbc6): undefined reference to __clzdi2'
fuck

#

this is for a riscv compile

peak cloak
#

ahhh, free at last

hazy saddle
#

i have to disable binary format speisfies

#

i can prolly add an emulation for that tho

clear bison
#

and have an arch-specifc implementation

hazy saddle
#

i just have to make a weak symbol for __clzdi2

#

or somthing iirc

hazy saddle
#

i think

#

i stole it

#

i forgor this exists

#

lmfao

#

why tf does npf use the other intrinsic tho

#

yup workin cross platform

hazy saddle
#

got buildIDs workin

hazy saddle
rotund furnace
#

why bother with mb2 at all tho?

hazy saddle
#

or some crap

hazy saddle
hazy saddle
#

i wonder if im making a mistake

#

redoing all this

rotund furnace
#

you rushed the fuck out of osdev

hazy saddle
#

im so sorry

rotund furnace
#

wdym

hazy saddle
#

idk

#

i feel bad

rotund furnace
#

why?

hazy saddle
#

for rushing osdev?

rotund furnace
#

who cares?

hazy saddle
#

feeling like an imposteor or somthin

#

CPUID is working now though

#

@rotund furnace though genuinly is this better than the old one

#

Ignoring the c++ memes

#

I’m gonna have arch::setup()

#

Which will do all arch specific setups

rotund furnace
#

how much of that is c++ and how much of that is having the foresight of osdev

hazy saddle
#

And then I’m gonna add in utils::panic() which goes to an arch backend

#

Maybe arch::panic()

clear bison
#

could technically make it boot with the linux protocol if i wanted to

#

or with any other protocol tbh

hazy saddle
#

And be mostly portable

#

Drop it in get MB2 working?

clear bison
#

it'll be probably be simpler to just make your own abstraction over the bootloaders

hazy saddle
#

My abstraction plan was to have functions that would interact with each bootloader seperatly

#

So I could make a basic MB2 pre kernel

#

Have it get some memory HHDM and map the kernel properly + identity map its self

#

Pass some data to the kernel before jumping into it

hazy saddle
#

new repo

#

may replace the old one later

soft snow
hazy saddle
#

Is it looking good though?

#

Also I wokeup and I’m going back to sleep

soft snow
soft snow
hazy saddle
#

Shit I think I found the bug

#

That was crashing the C verison

#

This is corrupting the heap

#

Lmfao 💀 @soft snow

#

Well I’m gonna go to sleep

#

Fix this in the morning

#

I’m still gonna do the C++ rewrite though tbh

soft snow
#

sleep well gn

#

my mlibc is doing well

hazy saddle
#

Nice node

hazy saddle
#

And not scalable

#

But atleast I can fix it

#

And leave it in a usable space

#

Maybe get bash ported still

magic saffron
#

interesting choice to support multiboot 2, whats the thought there?

mortal bane
clear bison
#

grub can't boot the limine protocol chad

hazy saddle
echo cloud
#

😭

hazy saddle
#

😭

#

I mean if it works it works

echo cloud
hazy saddle
#

It’s nothing like that

hazy saddle
rotund furnace
#

num_files being at byte offset 1,100,000,100,000 is insane

#

that's a terabyte of memory per directory

hazy saddle
#

That’s fine imo

#

5 level paging

#

Make it sparse

#

Best file system design ever

#

Just add a pointer to next file blocks

hazy saddle
#

Okay so

#

EvalynOS

#

Is gonna be archived

#

And the new C++ version

#

Is being renamed

#

To “Prism”

#

Unless anyone else has better name ideas

#

I may come back to this project later

hazy saddle
#

Once I pull up my energy to make the heap

#

I’m gonna make the new channel

#
  • new repo
marble ridge
#

rip EvalynOS

mortal bane
#

EvalynOS is ded nooo

hazy saddle
#

Though it would possibly be from scratch

#

Planning for the new version is going well

#

And the code that’s being done is pretty nice

rotund furnace
#

sounds like some nerd shit

#

just jump right into programming and figure out those details later

hazy saddle
hazy saddle
#

:p

rotund furnace
#

no microkernel :P

hazy saddle
#

Once I’ve actualy learnt shit

#

I’m doing a monolithic

#

And none of that hybrid shit

hazy saddle
#

Okay so

#

I have almost recovered enough to make heap

#

For multiboot 2 support I am going to work on the pre kernel

#

And I will be making it limine compliant

#

So hopefully any kernel can just import that project

#

And do a small bit of linker file changes

#

And then have multi boot 2 with no extra changes

#

If you already have been using limine

hazy saddle
#

@clear bison so how should I get started with multiboot 2

#

Also @rotund furnace @wanton grove this will including me making a heap for this shit

#

Which I will port to the kernel

#

So I’m not wasting time

hazy saddle
#

wonderful

hazy saddle
hazy saddle
#

then im gonna get it going into C and then long mode

#

and then loading the kernel mmLol

#

well the limine template first

#

then the real kernel

#

as i have to make a bunch if trabslation shits

wanton grove
#

solution: copypaste from limine

hazy saddle
#

nah mmLol

#

im making this public domain

#

which also technicaly means

#

public domain paging code for people

wanton grove
hazy saddle
#

im doing the 64bit mode one first

#

for the mb2 -> limine stub

clear bison
#

also, the memory map includes the regions containing the kernel and other stuff that you would probably want for it not to be there

hazy saddle
#

btw do you know how to make meson properly compile for this with assembly and stuff mmLol

#

I can’t find the limine meson template

hazy saddle
#

As it’s been fucking thanos snapped

clear bison
hazy saddle
#

Yes yes

hazy saddle
#

Because it’s in my fucking browsers auto complete

hazy saddle
#

Gonna be doing somthing like this @clear bison

#

And is there anyone that happens to be in here that knows how the fuck meson works

clear bison
#

interesting

hazy saddle
#

The 32 bit one will setup for the 64bit part

#

The 64bit part will then implement the limine protocol

#

That way any limine kernel can be booted via MB2

#

🤞

#

Or at the very least grub

clear bison
#

😂😭✌️

hazy saddle
#

😭

#

I mean

#

Technically

#

It should work

peak cloak
#

DO PAGING

#

GGEZ

hazy saddle
peak cloak
hazy saddle
peak cloak
#

32 BIT VERSION WE HAVE LIMINE FOR 64 BIT

hazy saddle
#

IM MAKING MB2 BOOT LIMINE KERNELS

peak cloak
urban mulch
hazy saddle
#

AND ADD MORE COMPTABILITY

urban mulch
#

DOES MB2 EVEN HAVE ALL THE INFO NEEDED FOR LIMINE SUPPORT

hazy saddle
#

IT PROBABLY HAS ENOUGH FOR MOST KERNELS AND I CAN EMULATE SOME

urban mulch
#

FAIR ENOUGH

peak cloak
#

OR OTHER CRAP THAT LIMINE HAS

#

LIKE MULTIPROCESSING

hazy saddle
#

MULTIBOOT2 WHAT DO YOU WANT FROM ME

#

😭

#

JUST WORK

#

IT CANT SEE IT

#

WHO TF MADE THIS CRAP

#

wait

#

it was seeing it as MB2

#

the command just gives no output

#

but this does nothing

#

is it even executeing any of my code

#

@clear bison do you know what im doing wrong to anger the multiboot2 gods

#

ngl why TS harder than making a UEFI bootloader from scratch

#

😭

#

i remember having an easier time

#

atleast in QEMU ovmf

peak cloak
#

instead of cli

#

check that way

peak cloak
peak cloak
hazy saddle
#

i fixed it

#

its all good

peak cloak
clear bison
hazy saddle
#

I made it work

clear bison
#

wrong header. you probably also forgot to pass the correct tags

hazy saddle
#

I just forgot to type boot

#

In grub

#

💀

#

That’s it

clear bison
#

MB2 has header tags which specify a ton of shi. you will want to mess with the "Information Request" tag and put in the list it has all the information tags you want on the MBI

#

Else the bootloader might just not pass them

hazy saddle
#

Yeah I’m probably gonna put as many requests as I can in?

#

Then get a basic PMM setup to get page tables for the 64bit stub

#

And then have that get a PMM and heap going

#

And then get limine shit booting

#

And pass it all over besides the memory map having stuff marked as bootloader reclaimable?

#

So then when the final conversion happens to limine stuff it’s easy

hazy saddle
#

The multiboot loader is working on real 32bit hardware

#

I’m going to work on the 32bit path first

#

Which will enable PAE and paging

#

And get the kernel mapped into the upper half

#

And pass the important info

#

And then I will add the limine conversion

#

It will still be code name MB2LMSTB

#

Because that’s gonna be its main purpose

#

But it will also be used to boot prism

hazy saddle
hazy saddle
#

Multiboot2 framebuffer gotten

#

🗣️ 🔥

#

I am also going to add the ear piercingly loud PC speaker 1khz screech

#

For if it can’t get a linear FB

#

Or if it cannot get one below 32bit (PAE)

#

Or if it wasn’t loaded by a MB2 loader

#

Oh also I’m porting flanterm and nanoprintf here

#

🗣️ 🔥

#

So I can like have debugging info

hazy saddle
#

GDT INIT BAD

#

But this is with nanoprintf too

#

So it’s got it all

#

I’m gonna work on the panic() function proper

#

So it can like dump registers and shit

#

Then make the GDT & IDT

#

Do paging

#

The basics

#

Get the kernel mapped and using my protocol

#

And we are going

mortal bane
#

EvalynOS ded sadmeme

hazy saddle
#

And renamed to prism.

#

And I’m not fully killing it off

mortal bane
hazy saddle
#

I plan to return at some point

#

But I made many footgun mistakes here

wanton grove
hazy saddle
#

New kernel is gonna be much more portable to archs and shit too

hazy saddle
mortal bane
hazy saddle
wanton grove
hazy saddle
#

EvalynOSv3 will be rust

mortal bane
hazy saddle
#

V2 will still be C tho

#

But that’s after prism

#

And after prism16

mortal bane
#

dayum

hazy saddle
#

Or EvalynOS-16

#

Because I want to try out a DOS clone at some point

wanton grove
hazy saddle
hazy saddle
#

Nah I mean after prism gets a good few ports and shit

#

I can go back and forth and stuffs

#

2028

wanton grove
#

prism forever

hazy saddle
#

I’m gonna rename the Chanel for this too

#

Later™

#

Once I finish the i686 bootloader

#

And make the heap

hazy saddle
opaque marten
#

ouch i686

hazy saddle
#

I’m working on the multiboot2 pre kernel

#

Which will hopefully make things less crap

#

🙏

#

Atleast for the kernel its self

urban mulch
#

Is FRED worth supporting?

hazy saddle
#

It’s very nice if you can get working

urban mulch
#

There don't seem to be many emulators that have it

hazy saddle
#

#resources message

urban mulch
#

Is there a proper manual for FRED or did you need to do some digging

hazy saddle
#

The manual is very good

hazy saddle
#

lets go

peak cloak
#

static gdt user 😔

#

ok ykw i dont blame you the gdt sucks bad

hazy saddle
#

Wellll

#

Using the wikis code

#

Just pre generated it

peak cloak
#

i remember assembling a 286 gdt by hand

#

it somehow worked

hazy saddle
peak cloak
#

literally nobody uses that crap

peak cloak
hazy saddle
#

Eg 286 mode

peak cloak
hazy saddle
#

Damn

peak cloak
#

if they removed that crap windows wouldve been 9/11'd

#

and thats the most important OS in history anyway trl

peak cloak
#

for memory trl

hazy saddle
peak cloak
hazy saddle
#

This is faster

#

To boot

#

And takes less code space

#

Okay uhhh @peak cloak what do I need now

#

I think I need the PMM?

#

And then to do paging

#

And then elf loading yeah

peak cloak
#

idk how you gonna load the pre kernel

hazy saddle
#

I’m not doing the long mode rn 🥀

#

@peak cloak this is the pre kernel

peak cloak
#

oh

hazy saddle
#

I have to load the 32bit version of the kernel

peak cloak
#

oh ok

hazy saddle
#

Prism kernel

#

Which should just need those things?

#

And il use PMM as heap PSP1G_pspTrollar

#

Or well il make it allocate things smaller then 4kb

peak cloak
peak cloak
#

fair

#

i have no idea what the difference is

#

so fair enough

hazy saddle
#

I do wonder

#

How small of a stack can this pre kernel use

#

Because I give it 64kb rn

peak cloak
hazy saddle
#

Maybe 4kb of stack is enough PSP1G_pspTrollar

peak cloak
#

maybe

#

crap i need finish config file parser

hazy saddle
#

Oh also the boot protocol will uhh be like this

#

Kernel goes in upper part

#

512mb of HHDM on the lower part + the identity map for bootloader

#

And then modules get loaded under the kernel

#

And the structure that the kernel gets will have pointers to them

peak cloak
#

virtual pointers or physical ones

hazy saddle
#

Virtual ofc

#

But it will have physical ones too

#

I will give both

peak cloak
#

i thought you had brain damage for a moment nooo

hazy saddle
#

I’m giving virtual because modules aren’t HHDMd

#

Also MB2 has a thing that makes me page align modules

#

So I should be good

peak cloak
#

why wouldnt you page align modules thinkong

hazy saddle
hazy saddle
peak cloak
hazy saddle
#

@peak cloak I wonder if I should make a bootloader PSP1G_pspTrollar

#

Like a full one

#

Nah

#

That will be annoying as fuck

peak cloak
#

please dont unless you're particularly dedicated nooo

hazy saddle
clear bison
#

you can just disable protection and you'll still be in real mode

peak cloak
#

i did it it exploded on me if i dont do it

clear bison
#

just with fukced up segments

peak cloak
#

im not messing with segments lololol trl

clear bison
#

which will indeed cause you to be in "unreal mode"

peak cloak
#

least real mode

clear bison
#

but you can fix that by just loading something in the segment registers lol

clear bison
#

well, anything that is correct for the current context

peak cloak
#

would 0 be fine?

clear bison
#

no

#

unless you placed your code at like 0x00000-0x0FFFF

#

when loading the CS

#

just put something that translates well into the physical address you're now

#

"unreal mode" isn't a separate cpu mode, is just real mode with the descriptor caches fucked up

#

loading the segment registers with something valid for real mode will get you out of it

#

you can't pull this shit off in pre-286 things because if i recall correctly there aren't descriptor caches to begin with lol

#

protected mode segmentation was added with the 286

hazy saddle
clear bison
#

nope

#

the x86 cpus only really check the GDT descriptors when they get loaded

#

even implied loads, like when getting an interrupt

hazy saddle
#

So what is the “cache”

clear bison
#

they use the descriptor caches to check and do calculations

hazy saddle
#

Or did IA16 have no GDT

clear bison
#

i don't think IA16 is a thing :P

#

pre-286 stuff didn't have a GDT or IDT

#

no protected mode segmentation there

hazy saddle
#

Well the 8086 :p

hazy saddle
clear bison
#

but these aren't really similar to the protected mode ones

#

protected mode uses the values in the descriptor cache to first check the privilege shit, then check if we're doing a code or data access, then add the base to the offset and then check the result of that against the limit

#

iirc

#

if any of that fails you get a GPF usually

#

or something similar to that

hazy saddle
#

I wonder could you make a 286 kernel PSP1G_pspTrollar

#

Like a proper one and crap

#

Or would it be super annoying

peak cloak
#

286 protected mode is slow as frigg

#

windows 2.1's 286 version used real mode

#

you also have to actively use the GDT

hazy saddle
#

MB2LMSTB will require PAE for now

hazy saddle
#

i am doing a limit as i am copying the data structs to a diffrent place

#

that way i can for every memory region check if it has a module and or the executable in it

#

and ignore such pages when setting up PMM

#

& same for when mapping modules to special place

#

which wont be HHDM

#

aswell the kernel to be loaded here will be considered a "module"

mortal bane
hazy saddle
#

So like loaded files from bootloader

mortal bane
hazy saddle
#

Your bootloader just gives them to you

#

And it’s not too bad to parse

#

Mostly just boilerplate

hazy saddle
#

@clear bison does the MB2 memory map have MB2 strucutes inside "free memory" regions?

#

or is it good enough to just check for modules and my own image?

#

eg what does MBI mean here?

#

multiboot information?

clear bison
hazy saddle
clear bison
#

the thing you get the tags from trl

hazy saddle
#

so how should i make sure im not fucking that up tro

clear bison
#

the mbi has a size field in the header iirc

#

so just exclude from EBX to EBX + that size

#

and it should be fine

hazy saddle
#

uhhh

#

thats just header length

clear bison
#

not this one

#

the MBI header

hazy saddle
#

ahh

#

let me check that trl

#

and print it

clear bison
#

it calls it total_size in the spec

hazy saddle
#

also is limiting the pre kernel to 8 modules a bad idea trl

#

okay yeah thats about right

#

il add and then round up and round down

#

@clear bison also since i load at 1MB il assume memory from 1mb to 2mb is reserved by me

clear bison
hazy saddle
#

damn

#

so 2mb to 4mb then

clear bison
# hazy saddle

Also this ain't really the size or the multiboot2 header but rather the MBI trl

#

just being pedantic with the naming :P

hazy saddle
#

;p

#

MB2 mbi should be inreserved region

#

my loader interface

#

will do this properly btw

clear bison
#

wha

hazy saddle
hazy saddle
clear bison
#

I don't even bother reserving it because i initialize the PMM after taking all the shit out of there

hazy saddle
#

i think il need it valid after some stuff?

clear bison
#

and my PMM is the only thing that might touch that area during the early init

clear bison
hazy saddle
#

to make the new memory map?

clear bison
#

the memory map i provide to my PMM already has all the stuff i need excluded

#

i can then trash everything that isn't the kernel and modules

hazy saddle
#

but the one im passing to the real kernel

clear bison
#

my PMM isn't for the prekernel

#

it's the real kernel

hazy saddle
#

dont i need PMM

#

for like paging

#

I mean I could use linker magic

#

To reserve some memory

#

And know it’s there

#

And then bump allocate from that?

clear bison
#

just grab a fixed area that can fit like 512 memmap entries and you should be good chad

#

whoever the fuck passes more than that probably has a broken UEFI impl

hazy saddle
#

That had all those fucked up regions

clear bison
#

that was just limine fucking shit up actually

hazy saddle
#

To like map the kernel to the higher half

clear bison
#

because they left space between the ACPI tables

#

was it?

hazy saddle
#

Somthing like that?

#

But like

#

Where should I get memory to be able to map shit

#

Because I need to map the kernel to the higher half

#

And i need to map the modules too

#

And the HHDM

#

And the identity map

clear bison
#

and initialize it with the memory map

hazy saddle
#

That’s what I’m trying to do

clear bison
#

then when you pass shi to the actual kernel you can just map all your crap as bootloader reclaimable

hazy saddle
#

exactly trl

rotund furnace
#

not just that

#

each acpi table it self was in 1 page of memory

#
  • 1 padding page
#

for some fucking reason

#

so each acpi table took up 2 pages of memory

clear bison
#

even then I'm guessing there weren't more than 512 memmap entries

hazy saddle
hazy saddle
#

Wait fuck

#

With the freelist

#

How should I handle reserving that memory

#

:p

#

I could go by the order I put things in the freelist

#

And count pages?

#

And skip those etc

#

Wait fuck that would be reversed

#

@rotund furnace Your the freelist person any ideas

clear bison
#

just, don't put it in the freeslist or use some flag?

#

my freelist doesn't cares about the used segments

#

like any good freelist would

#

:P

hazy saddle
echo cloud
# hazy saddle

setgdt and setup_gdt being separate functions is funny

echo cloud
peak cloak
hazy saddle
hazy saddle
#

It dosnt matter?

#

setup_ is the namespace anyways

echo cloud
#

It’s just a lot of people do shit like “init_gdt” without actually having an init namespacing

hazy saddle
#

Everything goes under setup_

echo cloud
#

Shit pisses me off 😭

hazy saddle
#

So like setup_idt

echo cloud
#

Yeah fair

hazy saddle
#

Or setup_paging

#

Etc etc

echo cloud
#

I have an init_ namespace but that’s only within init.c, each name space outside of init has a namespace_init and that gets called within my init_config()

hazy saddle
#

I think this loader protocol won’t do HHDM but do an identity map for the first 3.5gb and then the upper 512mb is for your kernel

#

And it will map the pages of the kernel binary up there from the loaded module

#
  • the BSS etc
#

Then it will give a memory map inside the identity map and the kernel will deal with how it wants to do things

#

And il ensure everything is inside the identity map or the loader will panic PSP1G_pspTrollar

#
  • there needs to be a region of memory that has no reserved stuff in it for me to use
#

I could also instead of a PMM

#

Make the binary have like 8mb of BSS

#

I can bump allocate from for paging tables

#

And call it a day PSP1G_pspTrollar

#

And then just tell the kernel that entire region is reclaim

#

Which honestly may be easier tbh

hollow crater
#

r u making a boot loader+custom protocol now damn :o

#

been away for a while so guess I missed a lot..

hazy saddle
#

To boot new kernel i686 port

#

So I have to provide shit

#

Or atleast fucking mappings

#

I think il do the PMM in chunks

#

And then when generating the final memory map to pass

#

I will simulate all the allocations

#

Checking for reserved etc

urban mulch
#

I think your best bet for the memory map response is to record the various unusable and ACPI reclaimable, etc. regions ahead of time. Then all you're left with is accounted for in the bootloader allocator, which you later read to find the usable and bootloader reclaimable memory.

#

This way you don't have to worry about 10 different types of unusable memory accounted for in the bootloader allocator.

hazy saddle
#

im not sure a good method for tracking such is

#

i mean i have ways but they seem bad™

urban mulch
magic saffron
#

Same goes for the rest of the protocol: mb2 is very barebones, limine defines a bit more.

hazy saddle
# magic saffron The lbp memory map makes more promises than the mb2 memory map like handling ove...

Yes but I’m working on the 32bit path right now. I already am handling the modules properly + using the tag to make sure they are aligned to page at the very least so I am able to see if a page is in some garbage region.

It’s just when I allocate from tree memory I don’t know how to track what I have used so I can mark it as reclaimable when I pass it to the real full kernel after mapping & such

magic saffron
#

Ah I assumed you were still doing a limine shim.

hazy saddle
#

That comes after I get 32bit working

#

Which still needs me to solve this issue to pass it to the 64 bit pre kernel which needs this information

magic saffron
#

Its still nice to follow those things even if its 32bit (e.g. make it a nice entry state for the kernel)

hazy saddle
#

Oh yes I am gonna be making a much nicer entry

#

For 32b I’m thinking lower 3.5gb is identity mapped and the 512mb upped is the minimum load address

magic saffron
hazy saddle
#

And il be giving a full structure with all the information needed to boot

hazy saddle
#

And MB2 puts me at a fixed physical address

#

So I’m limited on that afaik?

magic saffron
#

I'm not saying have your whole heap be statically allocated lol, just enough to get your pmm and p/vma up and running.

#

Then you can use those as normal.

hazy saddle
#

Oo I could that to bump allocate a heap to hold data structures for things I allocate?

#

Eg the “used” list

#

Then I can combine that with other reserved regions to make the final memory map

magic saffron
#

You could

hazy saddle
#

Any other better ways you’d think?

magic saffron
#

I'd either do it that way or try bootstrap things using only the stack. The latter is more annoying imo but perfectly doable.

hazy saddle
#

I think I have ~13MB to work with so I can just give myself 8MB of heap and call it a day PSP1G_pspTrollar

#

Given a load address of 2mb

magic saffron
#

8M is massive lol

hazy saddle
#

Il tune values after

#

I give a 64kb stack lmfao

magic saffron
#

Numbers from the days when ram was cheap 😔

hazy saddle
#

That should be enough for anybody

magic saffron
#

I hope you dont need more than 10 stacks 😆

hazy saddle
#

Maybe 8kb

urban mulch
#

Fortunately you're not writing it in rust, otherwise you'd need 16k just for hello world trl

hazy saddle
#

Yeahh I may want to do more than 4k PSP1G_pspTrollar

floral kettle
#

also put a guard page at the start (the lowest address) of it

#

its not fun to debug when you run out of stack space and start getting random corruption (granted a 4kb guard page isn't fully reliable either if you manage to create a large enough stack frame that it goes over it, though even then its likely that at some point you'd get an access to the page when accessing some variable or smth)

hazy saddle
floral kettle
#

ah yeah I somehow ignored the part about pre kernel lol

hazy saddle
#

Which then I realized

#

I can just do the same thing I do for the stack

#

And allocate it in BSS

#

And then I can get PMM and track used shit etc

clear bison
#

my mb2 prekernel parses shi before enabling paging and then just pases the info through the stack while at the same time marking itself as unused in the memory map, that does mean i have 2 freelist pmm things but eh

#

the actual kernel one is more complex

hazy saddle
#

But after paging is enabled I have to map the kernel up there and make the final memory map

#

Wait I could just

#

Make the tables first

#

Then enable it?

#

But that leads to the same issue so

#

Won’t make any difference

clear bison
#

hmm?

#

the map is just for physical memory

#

after you map shi in the higher half you don't really have to care were your kernel is physically apart from not marking it as usable

clear bison
#

you would get that sweet

hazy saddle
#

Trueeee

hazy saddle
#

i may change this to "bmb2" or better multiboot 2 PSP1G_pspTrollar

#

and i think the fact its gonna be public domain is gonna piss off the FSF

hazy saddle
#

yeah i am confused about the flanterm issue

#

it fully fails in anything but O0

#

and these vales look right

peak cloak
hazy saddle
hazy saddle
#

Memory map is properly being parsed

#

And reserved regions removed

#

So I can make the PMM

#

And my memmap code is flexible enough to allow me to remove the regions I used up from that

peak cloak
peak cloak
hazy saddle
#

@wanton grove time for you to make i686 paging btw

peak cloak
#

its the best one

hazy saddle
#

Jkjk

peak cloak
#

MUAHAHAAHAHAHAHAH

hazy saddle
#

😭

#

I’m actually just marking no PAE as unsupported

#

And it will say talk is cheap send patches

peak cloak
#

oh wait its pae paging

hazy saddle
#

Same as x86-64

#

Just missing a level

#

I think

wanton grove
#

does limine c template works ?

hazy saddle
#

im not even on that yet

#

I’m working on the custom mb2 protocol

clear bison
#

the only useful shit it could add is the NX bit

#

but that's not always implemented

hazy saddle
#

And most i686 systems support it

#

So it’s what I’m targeting first

clear bison
#

it's also a bit slower on i686s LiPerformDelisquesceUponObjectW

hazy saddle
#

Oh

#

Should I just not support PAE at all then

clear bison
#

i think you should just have a PAE and Non-PAE build

hazy saddle
#

Maybe?

#

But like