#AuroraOS

1 messages · Page 2 of 1

mental otter
#

Which i guess is vague

#

Does it include patch files that you need to modify a bunch?

#

Who knows

quaint cape
#

idk

#

yk which option im missing?

mental otter
#

You using mlibc master or release

quaint cape
mental otter
#

and did you use the script to download Linux headers?

quaint cape
#

maybe i should use release

mental otter
#

No I use master

quaint cape
mental otter
quaint cape
#

yes i copied ur stuff

#

word for word

mental otter
#

Yeah yeah

#

Did the symlinks copy right?

quaint cape
#

else it might just be something w the config

#

wait do you need the linux option enabled?

mental otter
#

No

#

You do need to manually say no to them though

#

But I know mlibc likes having the headers

quaint cape
mental otter
#

What do they link to?

quaint cape
#

symlinks*

mental otter
#

Copy the symlinks from the demo project

quaint cape
#

they have actual content inside of them

mental otter
#

That’s where I got my symlinks

#

Huh

#

That not right

quaint cape
#

Ima just steal astrals

mental otter
#

@quaint cape Did you also take my build script and patching system?

quaint cape
#

split it up into different files

mental otter
#

Remember never do this for major things or your knee caps say bye bye

mental otter
#

Try it without splitting it

mental otter
quaint cape
mental otter
#

The folder structure though

quaint cape
#

its prob just my abi bits being broken

mental otter
#

It may get mad or some shit

mental otter
quaint cape
#

and never fixed it

mental otter
#

It would be nice if you got my patches working so my kernel can be credited and others and be cool

quaint cape
#

so time to redo it right

mental otter
mental otter
#

My kernel is meant to also be very human readable to be reference

quaint cape
#

You will also get your very own place in the readme.

#

:D

mental otter
#

Because I may branch of my own kernels to others

#

:O

#

Oooo nice

mental otter
#

And having a good base is good

quaint cape
mental otter
#

I also want to buy the physical copies of the Intel SDM

#

It’s like 200 bucks for 5500 pages

#

Like god damn that’s a steal

quaint cape
mental otter
#

And then when people ask for help I can take a picture of the physical book XD

mental otter
#

@quaint cape Btw feel free to ping me whenever you need a hand

#

I love helping out with my knowledge

quaint cape
ionic palm
#

ngl build system can be annoying

mental otter
#

fr

ionic palm
#

how far wicks?

mental otter
#

Stealing my mlibc and gcc build scripts and patches

#

Which I got from astral for the psyches partly heh_face

ionic palm
#

i use newlib

mental otter
#

Mlibc is the most POSIX libc right

ionic palm
#

also just finished my kernel rewrite

quaint cape
quaint cape
ionic palm
#

almsot completed the OS??

quaint cape
#

mlibc

ionic palm
#

Oh nice

quaint cape
#

my rewrite is almost done too

mental otter
ionic palm
#

i just completed and pushed the changes

quaint cape
mental otter
#

I did try and do it manually but mmLol things were being fucky

ionic palm
#

git was having a stroke for some reason and refused to push it but fixed it smh

quaint cape
#

i got the total files i need to rewrite if i want to port it to another arch down to 8

#

its a maximum of 1k loc

mental otter
#

I’m gonna be in for a doozy when going to another arch

quaint cape
#

I've been abstracting hella lot lately.

mental otter
#

But il cross that bridge when I get there

#

And then abstract where needed

#

And same for SMP

ionic palm
#

i have no worries as my OS is uni-arch of x86_64

quaint cape
quaint cape
mental otter
#

I think il port to arm/risc-v whenever they have good desktop options that are open source

#

Mainly looking at the milkV titan with the VM extention

#

And or the PI5 once it’s a qemu target

quaint cape
#

I need to make a devfs before i can even think about porting to other arches tbh

ionic palm
#

also happy 1000+ messages

quaint cape
#

and maybe ext2 or ext4 drivers

quaint cape
ionic palm
#

all bits set

quaint cape
#

At the same thing im maintaing this im a lead dev for a rblx game so funny

quaint cape
#

Im also comitee for this club: were pretty active tbh

#

Only 44k messages

ionic palm
#

where?

quaint cape
#

And heres in the C++ server.

#

Together C C++

quaint cape
ionic palm
#

oh i see

ionic palm
ionic palm
mental otter
#

Just set the read and write function pointers to handlers for your drivers

mental otter
ionic palm
#

ASTERISK is must here

quaint cape
#

but i reworked my whole fs

#

like everything

#

cuz i didnt have a vfs before

#

so now i have to rewrite a big portion of my code.

#

its fine though right

ionic palm
mild shoal
#

I think its already better than glibc at this

mental otter
ionic palm
quaint cape
mental otter
#

I think it’s above Linux now

ionic palm
#

mlibc is way more readable

quaint cape
#

mlibc is the best libc out there.

mild shoal
mental otter
mild shoal
#

u need to get it from linux or write your own or whatever

mental otter
#

And I got no idea why it’s missing

mild shoal
#

probably was added recently and your patch is a bit old

quaint cape
ionic palm
#

also big fact that mlibc is portable whereas glibc is not because of linux

mental otter
#

I think my patches are from let me check the commit

mild shoal
quaint cape
mild shoal
#

mintsuki had to use an llm to sift through it and the patch file is like 17k lines

ionic palm
quaint cape
#

cuz evalynos has it for some reason

#

lool

mental otter
#

Has what?

quaint cape
quaint cape
mental otter
#

LMAO XD

ionic palm
mental otter
#

Honestly good use for LLMs as long as a human verifies it

ionic palm
#

LLM can be used to automate lots of stuff, which saves time

mental otter
#

Just don’t ask it to make an IDT

quaint cape
mental otter
#

@quaint cape How’s it going

quaint cape
mental otter
#

What error

quaint cape
#

Outdated mlibc stuff or sum

quaint cape
#

even though ive added the abi bit to my abi bits

#

now ive decided to clone ur mlibc and insert the auroraos sysdep to see if it helps

#

it might be something with the mlibc version ig

mental otter
#

Hmmmm

#

What sysdeps do you have?

#

Did you delete any of mine or set them to to stubs

#

That can break things

#

Maybe do a fzf for that file @quaint cape ?

quaint cape
#

it is right there

#

sigset_t

mental otter
#

h u h

#

And how does my kernels regular build script go

quaint cape
#

but when u check the sysroot they aint there

mental otter
#

What happens if you do a clean build

#

Delete the headers build folder

#

And start from ground zero

quaint cape
#

Ima do a full rebuild ig

#

ill update yall when its finished

mental otter
quaint cape
#

Ima go make myself some food

#

When ill be back its time to check on it again

mental otter
#

Sounds good

quaint cape
quaint cape
#
check_exception old: 0xd new 0xd
     1: v=08 e=0000 i=0 cpl=0 IP=0028:ffffffff800008e5 pc=ffffffff800008e5 SP=0030:ffff80003ff95f80 env->regs[R_EAX]=0000000000000028
RAX=0000000000000028 RBX=0000000000000000 RCX=ffff800000000000 RDX=00000000000003f8
RSI=0000000000000031 RDI=00000000000003f8 RBP=ffff80003ff95fa0 RSP=ffff80003ff95f80
R8 =ffff80003ff63000 R9 =ffff80003ff69088 R10=0000000000000000 R11=0000000000000000
R12=ffffffff80015160 R13=0000000000000000 R14=0000000000000001 R15=0000000000000000
RIP=ffffffff800008e5 RFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0030 0000000000000000 00000000 00009300 DPL=0 DS   [-WA]
CS =0028 0000000000000000 00000000 00209b00 DPL=0 CS64 [-RA]
SS =0030 0000000000000000 00000000 00009300 DPL=0 DS   [-WA]
DS =0030 0000000000000000 00000000 00009300 DPL=0 DS   [-WA]
FS =0030 0000000000000000 00000000 00009300 DPL=0 DS   [-WA]
GS =0030 0000000000000000 00000000 00009300 DPL=0 DS   [-WA]
LDT=0000 0000000000000000 00000000 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT=     ffff800000014f18 00000037
IDT=     ffffffff8001cc40 00000fff
CR0=80010011 CR2=0000000000000000 CR3=000000003ff60000 CR4=00000020
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=0000000000000008 CCD=0000000000000000 CCO=LOGICB
EFER=0000000000000d00
check_exception old: 0x8 new 0xd
``` yeayyy when i try to run the rewrite.
#

funny thing is that it fails in CPU which has never failed on the old system.

quaint cape
#

damn my fs tweaked out

quaint cape
#

@mental otter do u yk of any freestanding printf implementation that i can borrow

#

im starting to get anoyed of my current system

mental otter
#

Check how I use it in src/kernel/libc/stdio.c

quaint cape
mental otter
#

Honestly just copy paste it

#

It’s really simple

mental otter
#

Go Wild have fun idc put a comment if you want

quaint cape
#

its lit included here

mental otter
#

Yup XD

#

Although I implement a few other functions to make them wrap the same

#

There is a way to do it without a buffer like that too

quaint cape
#

Happy new year from the AuroraOS devs

#

-# or ig im the only dev so ye happy new year from me :D

#

Ill try to focus more on AuroraOS next year, maybe get xorg ported

#

so i can finally do something better than this colored bs screen

mental otter
#

Is it a working mlibc?

quaint cape
#

I made the OS run itself after the rewrite though

#

I run into the same mlibc error about that missing abi bit.

mental otter
#

Hm? In what way

quaint cape
#

Ik right its crazy

quaint cape
#

I have a hard time beliving that though

mental otter
#

why not try my OS build in your machine?

quaint cape
quaint cape
#

now im getting even more confused:

#

its lit right there

quaint cape
#

hmm attempt 2

#

think i found what was wrong

quaint cape
#

@mental otter do yk whats wrong?

mental otter
#

Did you ever compile mlibc as sudo before?

quaint cape
#

do i need to do that?

mental otter
#

No you shouldn’t

#

That can break your hosts headers

quaint cape
#

hmm think i fixed it

quaint cape
#

now im on the mlibc building part

#

anyways i cant manage to be up more

#

its 2 in the morning

#

gn

mild shoal
#

Youre missing some abi bits definitions, make sure u have it symlinked and in your sysdep's meson.build

quaint cape
quaint cape
#

missing it even though its right there under abi-bits/limits.h

mental otter
#

no 😭

#

wait

#

is that the right abibits folder

quaint cape
#

its also in the auroraos abi-bits folder

mental otter
#

that should be right

#

wtf

#

show me the meson file

quaint cape
#
if not no_headers
    install_headers(
        'include/abi-bits/auxv.h',
        'include/abi-bits/auxv.h',
        'include/abi-bits/blkcnt_t.h',
        'include/abi-bits/blksize_t.h',
        'include/abi-bits/clockid_t.h',
        'include/abi-bits/dev_t.h',
        'include/abi-bits/errno.h',
        'include/abi-bits/fcntl.h',
        'include/abi-bits/gid_t.h',
        'include/abi-bits/ino_t.h',
        'include/abi-bits/limits.h',
        'include/abi-bits/mode_t.h',
        'include/abi-bits/nlink_t.h',
        'include/abi-bits/pid_t.h',
        'include/abi-bits/seek-whence.h',
        'include/abi-bits/signal.h',
        'include/abi-bits/stat.h',
        'include/abi-bits/uid_t.h',
        'include/abi-bits/vm-flags.h',
        'include/abi-bits/wait.h',
        'include/abi-bits/riscv-hwprobe.h',
        'include/abi-bits/sigevent.h',
        'include/abi-bits/sigval.h',
        'include/abi-bits/sa_family_t.h',
        'include/abi-bits/sockaddr_storage.h',
        'include/abi-bits/sig-limits.h',
        'include/abi-bits/suseconds_t.h',
        'include/abi-bits/access.h',
        'include/abi-bits/socklen_t.h',
        'include/abi-bits/socket.h',
        'include/abi-bits/poll.h',
        'include/abi-bits/resource.h',
        'include/abi-bits/in.h',
        'include/abi-bits/rlim_t.h',
        'include/abi-bits/utsname.h',
        'include/abi-bits/fd_set.h',
        'include/abi-bits/sem.h',
        'include/abi-bits/time.h',
        'include/abi-bits/ipc.h',
        'include/abi-bits/statvfs.h',
        'include/abi-bits/fsblkcnt_t.h',
        'include/abi-bits/fsfilcnt_t.h',
        'include/abi-bits/shm.h',
        'include/abi-bits/termios.h',
        'include/abi-bits/msg.h',
        'include/abi-bits/mqueue.h',
        'include/abi-bits/utmp-defines.h',
        'include/abi-bits/utmpx.h',
        'include/abi-bits/sigset_t.h',
        subdir: 'abi-bits',
        follow_symlinks: true
    )
quaint cape
mental otter
#

is the symlink valid

#

whats in that file

quaint cape
quaint cape
quaint cape
#

First sign of life after rewrite:

#

Only problem is that the fs is cooked

#

Also added Limine wallpaper.

#

So ye I mainly have two problems to solve.

  1. The mlibc ahh weird issues.
  2. The FS malfunctioning ten times. (and yes with the fs i mean both tmpfs, vfs and tarfs)
ionic palm
#

no VFS???

quaint cape
#

fs.c and fs.h is vfs

#

just that i dont call it vfs

quaint cape
quaint cape
# mild shoal U need to add it manualy

Another stupid question, but how can this even happen:

../options/ansi/include/limits.h:161:10: fatal error: abi-bits/limits.h: No such file or directory
  161 | #include <abi-bits/limits.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
[14/311] Compiling C object options/ansi/libmlibc-musl-math.a.p/musl-gen
quaint cape
#

cuz i aint for sure missing a header

mild shoal
#

Maie sure u have both it on meson.build and the symlink and tbat it points to a valid file

#

U might need to reconfigure meson too

#

As in, recreate the buiold dir

quaint cape
mild shoal
#

Hm

#

What is your cmdline to build it

quaint cape
mild shoal
#

Do u install headers properly and if so did you rerun that step?

quaint cape
#

The headers are properly there.

quaint cape
quaint cape
mild shoal
#

Hold on let me get to my computer

#

Give me 15 min

quaint cape
mild shoal
#

Sure

quaint cape
#

Damn it wont let me have my git repo

#

pushed

#

Also keep in mind that you need to modify the sysroot file /bits/sigset_t.h and add #include <abi-bits/sigset_t.h> each time you rebuild lol

mild shoal
#

Why would u need to add that include

quaint cape
#

its to prevent the missing sigset_t types

mild shoal
#

That doesnt happen on my end nor in ci

quaint cape
quaint cape
mild shoal
#

When u upload the code Ill take a look

quaint cape
#

clone dev btw

#

and the build script is ./ports/mlibc/mlibc.sh (from root)

mild shoal
#

Can u send the link I dont jabe it

quaint cape
#

git clone https://codeberg.org/aurora-org/AuroraOS -b dev

mild shoal
#

Ok so found an issue already

#

U dont set the include dir anywhere

#
rtld_include_dirs += include_directories('sysdeps/menix/include')
    libc_include_dirs += include_directories('sysdeps/menix/include')
#

For example the menix ones

#

I dont see that in your code anywhere

quaint cape
mild shoal
#

Im not even in my laptop Im just skimming over the source

#

But yeah that is an issue

quaint cape
#

Ima try rebuilding with those defined.

quaint cape
quaint cape
#

finally.....

#

@mental otter :D

mild shoal
#

What was the issue?

quaint cape
#

I just cloned the main branch and dropped in my sysdeps.

#

And it worked.

quaint cape
#

Damn i really succeded at making a great fs: 😭

mental otter
#

@quaint cape The elf’s a loading now?

quaint cape
quaint cape
#

but elf loading and scheduling and shi was done before

#

so its already implemented.

quaint cape
#

Development paused for 5 days.

#

Ima be away from my computer

#

Still can respond to DMs from my phone though.

quaint cape
#

First day of camp guys, it's been kind of crazy tbh. Great lads though.

quaint cape
#

Back today guys, can anyone remind me of what I've been doin.

mental otter
quaint cape
#

Ahh ye, fcking fs.

#

Well that needs to be fixed yes.

mental otter
#

you were also gonna sign all legal rights of your kernel to mr snrub

quaint cape
#

Mr snub the greatest.

quaint cape
#

wtf is wrong with this fs

#

hmm does directory creating work or not

#

okay path handling scuffed.

#

/init.elf works

#

but not /init/init.elf

quaint cape
#

hmm this darn fs

ionic palm
mental otter
#

@quaint cape I wonder if you can make the FS as a userspace app on your system and run test suites on it to better get it working?

#

Then port it back

quaint cape
#

i know whats failing, just not why its failing lol

quaint cape
#

Guys what does uacpi actually need?

quaint cape
mental otter
mental otter
#

@quaint cape link to code?

quaint cape
mental otter
#

this looks really fuckin sus

vital summit
#

it's weird. you don't need strlen

#

iterate the string once.

#

normalise paths before basename so the end / isn't a problem and just keep a ptr to the last / and then the basename is all after that ptr when you see \0

vital summit
#

assuming the path is stored normalised so you only normalise once not in each function call:

static inline const char *basename(const char *path){
    const char *base = path;
    const char *p = path;

    while(*p){
        if(*p == '/'){
            base = p + 1;
        }
        p++;
    }

    return base;
}
quaint cape
#

Our school had a fire alarm so freezing my butt off rn standing outside.

quaint cape
#

if you look on the bright side as long as its not in a long path it works.

quaint cape
#

like aslong as its not really a path it works fine right :D

#

/text.txt works

#

but not /txt/text.txt

mental otter
#

What about /a/a.txt

quaint cape
#

its something with the dir setup

#

it can create dirs

#

but cant create anything in them

mental otter
#

It can’t do nesting

quaint cape
#

it complains about create method not being there

mental otter
#

Hmmm

quaint cape
mental otter
quaint cape
mental otter
#

Well there it is

quaint cape
#

then there has to be something wrong with my tar fs or sum

#

how tf did /bin/ become a file

#

ohh wait no, its a dir

#

my debug outputs are so messy they are unreadable.

#

wait im suspecting everything is flipped

#

all files are created as dirs and then all dirs are files

#

@mental otter is it only me but this looks completely flipped, all files are dirs and all dirs are files

quaint cape
#

Hmm idk... This just seems so weird.

quaint cape
#

Reworked a bit more in the arch directory.

#

Now I realised i prob need to rework my logging implementation as it's messy asf.

quaint cape
#

I have to port bash before this summer at least.

#

Also thanks to everyone who starred AuroraOS, I'm hoping to hit 10 stars as I had on my old gh repo.

quaint cape
#

Reworked my whole printing system

#

Now it uses nanoprintf

#

How it looks now:

quaint cape
#

damn guys look im able to write negative bytes to a file loool

#

anyways its cuz everything is flipped

#

ima fix it today hopefully.

quaint cape
#

got sidetracked impl sysfs now

#

@mental otter do yk how capable your kernel needs to be to run uacpi

mental otter
quaint cape
#

astrals glue

quaint cape
mental otter
#

Based

#

Do you think I am smart enough to contribute XD

quaint cape
mental otter
#

If I’m not too busy with my own I can take a looksie

#

Maybe I can port my new timer drivers

quaint cape
quaint cape
#

Implemented sysfs

#

Also fixed all fs issues yeeeee

#

Im hopeful i fixed all issues but im unsure.

#

@mental otter you have any ideas on how i would organize my syscalls

mental otter
#

No and mine are shit

#

I’ve been cooking some ideas tho

quaint cape
#

i feel like its super messy rn as they are all in one single 1k lines file

#

yk what ima just put them all in seperate files in a folder.

#

call it a day

mental otter
#

What’s all in one files like that

quaint cape
#

welcome to unreadable bs

ionic palm
quaint cape
#

anyways ima try to make it suck less

#

so ill switch them up.

#

i think this rewrite was really needed.

ionic palm
quaint cape
ionic palm
#

570 lines of nonsense syscall stubs for newlib

quaint cape
ionic palm
#

newlib nooo

quaint cape
#

fixed it now they are all in seperate files.

mental otter
midnight rampart
#

Its the core stuff a kernel needs really, some basic virtual memory stuff, spinlocks and mutexes, heap allocator, and raw pci access.

vital summit
quaint cape
vital summit
#

fact of the day: linux kernel formatting just says you should indent with 8 characters. it does not say what that character is. brb, submitting a change to the linux kernel with 8-tab indents.

mental otter
mental otter
vital summit
#

i copied your screenshot

mental otter
#

Like it’s not the strangest thing to happen on the mailing lists

quaint cape
#

It's kind of mid actually but it works atleast

#

now my documentation is a tiny tad better.

quaint cape
#

these classes are so boring i just write docs the whole time since that is the only thing you can do on your school chromebook

quaint cape
#

Damn my proc logic is broken smh

#

now proc_exec wont work 😭

#

it just goes to idle and complains about no new proc being found.

#

Fixed.

#

It was me somehow commenting out thread create

#

😭

quaint cape
#

Now i dont even know what the issue is anymore.

quaint cape
#

I'm going to try to fix the scheduler tmrw ig. Still unsure what the issue is.

ionic palm
quaint cape
#

Damn might have to rewrite some more proc logic.

quaint cape
#

after that i can hopefully run bash

quaint cape
#

If you're ever bored feel free to read the AuroraOS docs.

ashen plume
#

I only have in code comments as documentation

#

And even those are minimal in a lot of places

#

Like for example my vmm isn’t commented at all

quaint cape
#

Damn still unsure about what this sched issue is

quaint cape
#

thats more general kernel information.

quaint cape
#

i like how my IDT doesnt even catch this exception

#

something has to be really messed up

quaint cape
#

Best way to fix the issue is to rewrite the whole scheduler right!!!

#

So that's what ima be doin.

mental otter
#

And was it the logic on switching tasks

mental otter
#

Making it crash

#

Or the picking of tasks

#

BTW it may break if the next task is the same as the old task so should check for that case and return normally rather than attempt a switch

#

That was an issue I faced

quaint cape
quaint cape
quaint cape
mental otter
quaint cape
#

havent looked at it for a year

mental otter
#

If you don’t handle a double fault it goes to a triple fault

quaint cape
#

it goes all the way to a triple fault.

mental otter
#

You could steal my scheduler code

#

For task switching

#

It’s only like 7 pounds of glue and duct tape

#

It’s really fucking picky

#

I think I found out why a while ago

#

I think I was fucking ip alignment

#

But I CBA to fiddle with it when it works

quaint cape
#

but first ima watch jetlag the game

mental otter
mental otter
#

Literaly just make it run panic()

#

That’s it

quaint cape
mental otter
quaint cape
mental otter
quaint cape
# mental otter What does it do
check_exception old: 0xffffffff new 0xe
check_exception old: 0xe new 0xe
check_exception old: 0x8 new 0xe

The thing interesting is that it's all just pointing to userspace RIP so it's impossible to debug lol

mental otter
#

Is your IDT pointing to user code?

quaint cape
mental otter
#

I mean you’re saying it’s pointing to userspace RIP?

quaint cape
#

The exceptions occur as soon as i jump into userspace.

#

Maybe I dont map the IDT into the pml4? idk

mental otter
#

Wait wait wait

#

How are you cloning page tables

mental otter
#

Il just tell you how it’s meant to be done

#

Okay so the PML4 is one page

#

Right

#

You get a new page copy the entire thing

#

And then zero out the user half

#

So that the kernel mappings are the same

#

Aswell you need to ensure the entire upper half is filled with PML3s

#

And that they will never be deallocated by your VMM

#

That way your kernel always stays mapped across all mappings

quaint cape
#

anyways theres my page code.

mental otter
#

You memset the entire thing

quaint cape
#

i didnt realise that

mental otter
#

Told ya

quaint cape
#

i just thought i were supposed to memset the whole thing to wipe it

mental otter
#

Its also why you do higher half kernels

#

It’s an optimization to do it like this

#

And also makes checking if it’s a user pointer easier

quaint cape
quaint cape
#

ohh wait that didnt work

quaint cape
#

Welp time to get to work writing more docs

quaint cape
#

my main function is so short nowadays

mental otter
#

imo id inline that or replace it with arch spesific things for asbtraction

quaint cape
#

its a full fletched init routine stolen from Mathewnd, so i can add or remove whatever I want.

mental otter
#

like have the main fucntions call the init stuff

#

the starting rotuines

mental otter
#

put this function inside the main function

quaint cape
mental otter
#

instead of calling it

quaint cape
mental otter
#

really?

quaint cape
#

the good thing with the init routine is that it doesnt matter what arch i have

mental otter
#

really?

quaint cape
#

yea

mental otter
#

how does it work internaly

mental otter
quaint cape
#

i have one dependencie "arch_ok" which signals the arch stuff is done.

#

And that one is defined in each arch.

mental otter
#

math is smart

quaint cape
quaint cape
mental otter
#

not a fixed thing

#

wait what is this for?

quaint cape
#

exec

mental otter
#

loading a user proces

#

yes

#

it looks fine

quaint cape
#

see if anything is terribly wrong.

mental otter
#

where is it crashin

quaint cape
#

userspace RIP

mental otter
#

what fault

#

what error

quaint cape
#

looks like PF

#

my handler doesnt catch it somehow

#

also why tf is RIP 00000 all of a sudden

mental otter
#

put the error code in here for PF

quaint cape
mental otter
#

Reserved right?

quaint cape
#

something is up with my paging.

mental otter
#

Yes

#

You wana steal my fancy new paging code XD

#

Just dosnt have page table freeing yet pain

quaint cape
#

i think its the setup

mental otter
#

Maybe

#

What even is the reserved bit

quaint cape
mental otter
#

Your paging code is probably fucked then

quaint cape
#

for sure hope its not.

mental otter
#

Bit 3 (RSVD) indicates whether a reserved bit was set in some page-structure entry

quaint cape
#

Damn this things actually good

mental otter
ionic palm
#

looking at code obviously

quaint cape
#

Welp my parents just told me to use Windows instead of Linux (dw i will still keep linux on my laptop) so now I have to translate all build instructions to windows.

#

or use jinx or sum

quaint cape
mental otter
#

You just may not have KVM

quaint cape
#

yall should I do a full sched rewrite?

#

I feel like it might be nessecary

#

I might have to i just realised how much bs it is

quaint cape
#

ehh so i did rewrite quite a bit of the scheduler

#

ima have to rewrite my fd system lol

#

its so scuffed

quaint cape
#

okay so i fixed a lot damn

#

also arch abstracted quite a bit

quaint cape
#

current todo:

  • fix this PF thing
  • rework it to be per process specific fds
#

reworked stack setup so its in assembly

quaint cape
#

Might need to focus on fds

ionic palm
quaint cape
ionic palm
quaint cape
#

might have to remake that too

#

implemented per cpu run-queue

quaint cape
#

GREATTT

#

always love when the PID is -2321312312312

ionic palm
#

completely fair scheduler 🤓

#

well personally i use the MLFQ

#

just that CFS is way better

quaint cape
#

I like how in the latest rewrite the arch.c file has become the trash file where i throw everything which doesnt have a place in.

quaint cape
#

Just enabled logging each page that maps

#

its taking so long to even map the initial memory

#

@mental otter How long do you think this will take

mental otter
#

I did this too for a log dump

#

I had to lower the memory to 96MB

#

To make it bearable at all

quaint cape
#

i just realised i have 1 gb memory

mental otter
#

💀

quaint cape
mental otter
#

also you could maybe speed it up by disabling flanterm and just spitting out to E9

quaint cape
mental otter
quaint cape
#

like its only 25 mb

#

How little memory can you kernel run in?

quaint cape
#

mb

mental otter
#

Maybe my newer version can handle some things a bit better

quaint cape
#

tbh ima take a break today

#

i'm sleep deprived so ye

#

gn everyone

quaint cape
#

Fixed the first page fault it was me passing phys addr instead of virt addr into my map_page func

#

now i get another one yeee

quaint cape
#

What should I do guys?

  • Keep the name AuroraOS.
  • Change to snowix
#

There's so many people confusing AuroraOS with arch linux and the linux dist AuroraOS

#

I we're also able to highjack the codeberg org name snowix: https://codeberg.org/snowix

#

@ionic palm what do you think

ionic palm
quaint cape
#

Anyways ima try to find a good name for Axeial.

quaint cape
#

What do you want for theme

#

For example I live in sweden so i like winter.

ionic palm
#

my OS is unix-like

mental otter
#

Keep it the same

quaint cape
#

This is much nicerrr.

mental otter
#

True true

#

Though I’d maybe pick a diffrent image

quaint cape
#

it's just a snowflake in ascii art though

mental otter
#

It looks really strange on mobile

#

Though I kinda see it if I zoom in

quaint cape
quaint cape
chrome cosmos
#

good new name. i knew i'd heard auroraos somewhere else, but figured it was one of those names which was inevitably going to be reused a lot.

vital summit
#

i should have just called my os "OS" kekeke

#

i mean nobody else has

quaint cape
chrome cosmos
#

sweet ascii snowflake

#

wait, yahoo mail is still working? i migrated and lost my login details years ago because i thought it was shutting down

#

good building instructions. i normally don't bother trying oss unless they have a disk image, but this had me thinking about it. but i don't really want to try building on cygwin when i'm half asleep ☺️

ionic palm
quaint cape
#

It's brand new so it's appreciated.

ionic palm
#

Nice

quaint cape
#

Ehmm so do I open a new thread for it?

#

yk what ima maintain AuroraOS until I get bash running on snowix

#

Then ima quit this thread and close it

chrome cosmos
#

oh? snowix is a whole restart, not a rename?

quaint cape
#

Not a whole restart

#

I'll prob restructure a bit but not remake the whole thing.

chrome cosmos
#

ah yeah, rewrites can be good

quaint cape
#

just a crazy idea on my mind

chrome cosmos
#

that'll up the workload. you won't be bored!

quaint cape
#

Well, theoretically it wont be thaat hard if it just is a transpiler and not compiler.

chrome cosmos
#

yeah, you won't need to optimize

quaint cape
#

Then the question is if it should transpile to C or LLVM?

quaint cape
chrome cosmos
#

though with modern cpus essentially being optimizing machine-code transpilers themselves... idk 🙂

mental otter
quaint cape
#

it would also be better

mental otter
#

probaly can get optmized better too

#

and intercompatability is easier

quaint cape
quaint cape
chrome cosmos
#

ya, c optimization is nuts

quaint cape
#

well thats the game plan then

#

Ima leave this thread as AuroraOS

#

but I'll prob be busy making the language.

quaint cape
#

Starting with transpiler

#

Ima see how far i get within a week

chrome cosmos
#

have fun!

mental otter
#

@quaint cape you got this

quaint cape
#

but its gonna be worth it

quaint cape
#

i think i got a basic version working

quaint cape
#

I think it's pretty okay.

ionic palm
quaint cape
ionic palm
quaint cape
#

its for snow

quaint cape
#

This is the syntax im aiming for:

import builtin.stdio


func main(i32: argc, string[]: argv) -> i32 { // 1 arg = name
  stdio.printf("Hello, %s", argv[1]);
  return 0;
}
quaint cape
#

Therefore the main function in snowix would be:

import arch.arch as arch
import lib.print as io
import core.init as init
import task.exec as exec
import task.proc as proc
import task.sched as sched

func main() -> ! {
  init.run_all_routines();
  
  proc.proc_t * init_p = proc.create();
  exec.exec(init_p, "/init/init.elf");
  
  sched.start();

  io.kprint(ERROR, "Ohh no something terrible happened :skull:, looping forever.");
  
  for (;;) {
    arch.hcf!() ;
  }
  
}

#

This is just me purely dreaming on how a perfect lang would be

#

@mental otter Does this look good?

ionic palm
#

with the semi-colons and braces

quaint cape
mental otter
ionic palm
mental otter
quaint cape
#

I love the -> but python also has that

#

Some stuff in rust is garbage though

ionic palm
#

what would it be for "in your OS?"

#

Scripting?

mental otter
oak charm
oak charm
# quaint cape I love the -> but python also has that

in rust -> exists because it borrows it of ML family languages, function types are denoted as a -> b
e.g. in OCaml:

let rec factorial : int -> int = function
  | 0 -> 1
  | n -> n * factorial (n - 1)

Although usually you'd write it as

let rec factorial (n : int) : int = match n with
  | 0 -> 1
  | n -> n * factorial (n - 1)

Not sure what motivated Graydon to use ->, even in ML languages you'd not see many people write functions that way (some times in special cases), however rust does allow named arguments (and it doesn't curry as well) with this syntax so it's a little weird. IMO it would have been fine if it did the Zig thing.

oak charm
#

also use void instead of !, try to minimize symbol soup

quaint cape
#

Not a compiler.

mental otter
oak charm
#

idk this for (;;) {} just bugs me >:M

mental otter
#

C++ gets a pass because it’s still mostly just C

oak charm
#

I guess you won't like my language at all then

#

lel

chrome cosmos
#

for(;;) bugged me when i was new to it, but that was long ago. i'm fine with it now, though i prefer breaking out of always-infinite loops. what i don't like is when languages have all possible loop options because it's a lot of mental clutter and they're never enough, lol.

oak charm
#

wouldn't want to be doing ex falso quodlibet in our type systems

chrome cosmos
#

what kind of type is unit?

oak charm
chrome cosmos
#

oh i see

#

i'd call that 'empty', of which 'void' is pretty-much a synonym

#

except the type itself isn't really empty, is it? ponders

oak charm
#

the more theory bs is that:

  • in category theory it's called a terminal object, every object has a unique outgoing morphism to 1 (e.g f : X -> 1)
  • in type theory it's a type with a single inhabitant, a () or any arbitrary literal that the implementor decides
  • in formal logic it corresponds directly to truth (⊤)
oak charm
#

we call it bottom, void, 0 or false

oak charm
chrome cosmos
#

interesting

oak charm
#

the more theory bs is that:

  • in category theory it's called a initial object, there's a unique outgoing object from 0 to every other object (e.g f : 0 -> X)
  • in type theory it's a type with NO inhabitant (Bottom in haskell IIRC)
  • in formal logic it corresponds directly to falsehood (⊥)
#

some people like to call it Void or Empty because it's like a empty set

#

even tho it isn't

chrome cosmos
#

oof. my brain's imploding, but i'll remember that there are types which aren't empty although containing only 1 empty object, and i can understand there are reasons for that even though i can't (at the moment) understand what the reasons are.

oak charm
#

you can have a nonsense literal as well

chrome cosmos
#

fun

mental otter
chrome cosmos
#

i'm grounded in bits and bytes. (c fits right into that, though i started with basic and asm.) theory is like another planet which looks intriguing but getting there seems like a big journey. 😉

oak charm
oak charm
# chrome cosmos fun

in rocq:

Inductive unit : Type := tt.

hehe
You can do the same in haskell:

data Unit = Tt
#

and the same thing in any other FP

#

and uhh in typed racket as well:

(define-type Unit 'tt)
#

i think

oak charm
#

so uhh C does that perfectly fine IME KEKW

chrome cosmos
oak charm
oak charm
#

anyways we've gone pretty far, I guess I shouldn't scare Wick X)

chrome cosmos
#

hehe yeah

quaint cape
#

I've just been hanging out with friends lol

chrome cosmos
#

just theory discussion 🙂

quaint cape
chrome cosmos
quaint cape
#

Okay, damn I'm getting a lot of projects to maintain.

#

AuroraOS, AuroraDB, Snowix, Snow, Snowerr, RoofNut...

#

I'ma drop everything exept AuroraOS, Snowix, Snow and Snowerr.

#

And I'll give some more updates to AuroraOS

oak charm
#

be me and have a thousand tiny projects

#

well uhhhh currently focused on maelstrom: diagram

#

greyed out means done, yes I have only completed one KEKW
I don't compile it to anything yet tho

quaint cape
# oak charm too weak

Well tbh AuroraOS is 100 hundred small project in itself, also I have more that I didnt include cuz they are tooo small.

quaint cape
#

Anyways this is how far I've come:

import random as random 
import lib.print as io

fn main() -> i32 {
   
  i32 random_num = random.random();

  if (random_num != "21") {
    io.printf("Yeaaaa");     
  } else {
    return -1; 
  }

  return 0;
}
#

This works

#

Ima clean up the codebase and commit later today or tmrw.

#

I have to add a better semantic analyzer and error system though.

#

And make it cleaner and less libc dependent.

quaint cape
#

Ima rewrite the messy backend tmrw and also work a bit on maybe adding classes and doing some general bug fixes and improvement, maybe adding some runtime support too

quaint cape
#

implementing stuff

#

classes etc

oak charm
#

what is your object system like?

oak charm
oak charm
#

umm not exactly prehistory, that's a different repo

quaint cape
#

i am inspired by rust yes.

oak charm
quaint cape
oak charm
quaint cape
#

That just transpiles into C.

oak charm
quaint cape
oak charm
#

in your opinion

oak charm
#

for Aurora as well

quaint cape
oak charm
#

still fine though

#

gl

oak charm
quaint cape
#

:D

quaint cape
#

Once I get a bit further with snowix I'll open a new thread.

quaint cape
#

What should I do to make it different.

#

Try to get better runtime support?

oak charm
quaint cape
oak charm
oak charm
#

I'm not trying to sound discouraging btw, sorry if I sounded like that

quaint cape
oak charm
# quaint cape im asking what you would like lol

all of what I'd like to see will make your language finish in 2074
but in general what I'd like to see is a different memory management approach, although that's a pretty hard task, something I'm kind of struggling with my self

quaint cape
#

memory management would be quite hard to change.

#

since it's only a transpiler.

oak charm
#

another thing are some niche new academic topics, like effect handlers, or stuff like that. but that'd get too out of topic nvm

oak charm
quaint cape
#

I need to create my builtin library.

oak charm
#

this way you perform analysis on the source, and compile it to C according to the analysis (allocate value here, move here, free here) etc

quaint cape
#

Even more bugfixing.

#

Anyways snow is pretty capable nwo.

quaint cape
#

This is how far it has came.

#
import builtin.math as math

extern C {
#include <stdio.h>
}

fn main() {
  i32 result = math.add(1, 20);
  printf("%d", result);
}
#

sometimes it hangs just randomly lolll

oak charm
#

that is concerning lol

#

the compiler or the generated program

quaint cape
#

thats just on my hand though.

#

some more bugfixing needed.

quaint cape
#

Fixed extern statements being buggy.

#

Ima also have to fix the parser infinite loop soon.

quaint cape
#

Anyways, might take up AuroraOS development for now.

#

I'll meanwhile work on snow and fix bugs and develop the language. After a month or two I'll rewrite AuroraOS in snow.

#

I need some time on this language, dont want to rush it and then be needing to change everything each 10 minutes.

#

I might try to make some sort of borrowing system.

quaint cape
#

So far this even I:

  • fixed elf loading issues. (auroraos)
  • fixed some vfs issues. (auroraos)
  • fixed types being broken (snow)
quaint cape
#

fixed timer issues

quaint cape
#

still fighting with PF's.

#

Also binge watching AWP all of a sudden.

quaint cape
#

Adding more stuff to snow now ig.

quaint cape
#

Thinking about adding some sort of config file in my initrd module to allow me to have better config.

#

@mental otter Do yk what format I should use? I thought about TOML, it might be good.

mental otter
#

Why not a kernel cmdline?

#

Like how Linux and other things do it to config the kernel

quaint cape
#

And also regulate debug prints etc..

mental otter
#

The cmdline can be parsed right away before mounting an initrd

mental otter
#

Before paging and crap too

#

You could have both? And have your init program read the config file and then tell the kernel certain things

quaint cape
mental otter
#

I mean that would duplicate things no?

#

A cmdline parser is really simple too

#

Depending on what your confinging

#

If it can wait to initramfs mount

#

It can wait for the init server to tell the kernel and parse the full file

#

A TOML or other parser would be heavy in your kernel

#

Look at how my kernel handles it

quaint cape
quaint cape
#

toml-c

mental otter
#

Still like stack size limits or something

quaint cape
#

And now comes the hardest part, which file should the config parser be in 😭

quaint cape
#

FInally fixed all mlibc build error.

#

So now you dont have to do 3 hours of manual setup when trying to build mlibc

prime river
#

If I understand correctly, RAX, RCX, RDX, R8, R9, R10, and R11 shouldn't be saved by the scheduler

quaint cape
#

Check out newest commit.

#

@prime river

prime river
#

Ah I see

#

Actually I might have been mistaken

#

I'm implementing my own scheduler, that's why I was looking at yours. I think you do it right

quaint cape
#

And I would have to say that after the rewrite my scheduler is actually semi decent.

midnight rampart
#

I saw someone use ⁨⁨[[gnu::no_callee_saved_registers]]⁩⁩ for their context switch function the other day too, thats a neat trick if you dont need access to them (the attribute is target specific, maybe dont do this).

prime river
midnight rampart
#

yes

prime river
midnight rampart
quaint cape
#

I'ma have to work a bit more on my scheduler tbh

#

It still crashes.

#

Once jumping into a userspace program.

quaint cape
#

imm so stupid

#

im a fcking idiot

#

i marked something as static instead of extern in a header

#

thats why the PF happens 😭

#

Im just that idiotic

#

ohh and now I get another PF-

#

fun :D

ashen plume