#AntiniOS
1 messages · Page 1 of 1 (latest)
so far it has:
- a working build (obviously)
- vga screen drawing (bare minimum)
- a write command that can handle newlines
- a terminal scroll which works like how it should be done where it pushes everything up only when you are on the last line and try to make a new one (rather than just making an extra line
- a terminal management type of thing where the cursor is updated as well as clear screen is
and thats it
working on a bare-bones minimum GDT rn
nice
nice we are waiting
for now yes since i havent made a shell
i literally started it today
ik it was init commit i removed it
ok, can i clone it and build it?
i can skip that
follow the osdev wiki to do that
no you have to
its specifically to strip out stdlibs and for the i686 architecture
no what?
it takes max 30 mins for gcc to build
and at most 15-20 minutes for binutils
what pc u got?
without gdb
i7 vpro 11th gen
i mean im on pc
16 gb ram + 8 gb extended
before i was building it on school laptop
i got 16gb ram with i5-9400f
rtx 2060
💀 2019 pc
looks like im using curl https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/
or wget actually
@vale pebble how do i use enable_cursor, like what args do i give it
for start_cursor and end_cursor
start pixel to end pixel?
or like start 80 end 25
i havent tested it properly
dont use it for now
the cursor is enabled by default
ok
what are your goals, its best to make a list of goals first
before it gets complex and you dont know what to do next
execution and programs
IDT, GDT
and drivers
kk
not much lol
yeah
idt is for interrupts btw
interrupt description table or smth like that
*descriptor
oh ok
why is that needed, in osdev i have never heard of an os needing an idt
im downloading precompiled i686 cross compiler
downloading a build script
GOSH DANG i wanna quickly build this awesome os
AntiniOS is gonna be a big project soon
UGH my wsl keeps crashing
do you want to handle interrupts?
if yes, you need an IDT
or IVT in real mode
🤦♂️
i686 is about the available instruction set
you can still run real mode on a Pentium Pro
and use cmov in real mode
i686 means 32 bit
you can emulate an 8088/8086 on an i686 supporting cpu, but its not i686 mode
we are writing i686 mode
well, im trying to work on pratyushes code, but he/she wrote it
no
there is
there is
nah
what is i686 mode?
32 bit
are you referring to protected mode?
@harsh cargo
there is no such thing as 16-bit/32-bit/64-bit mode
64 bit can go right back to 16 bit
they are different modes
I only use chonk mode
32 bit is submode of protected, 16 bit is submode of real
so in summary, there's no such thing as i686 mode, there's protected mode, which was introduced with the 286
NO
there's 16-bit protected mode
there's 16-bit compatibility mode under long mode
thats not what people know 16 bit as
no, it is
i didnt ask for anyone to come to this thread
is Windows 3.1 not 16-bit?
Extra extra chonk mode
is OS/2 1.x not 16-bit?
well
you're spreading misinformation
which violates rule 11 of this server
huh misinformation
it isnt misinformation if i didnt know that it was
sooooooooooooooooo
it is
it isnt a rule violation
murder is not a crime if I didn't know it's a crime
you aren't taking any corrections
well, it is, you're just not getting punished for it if it was accidental
misinformation is someone knowingly spreading it
you're ignoring anyone correcting you
Misinformation is incorrect or misleading information.[1][2] Misinformation can exist without specific malicious intent; disinformation is distinct in that it is deliberately deceptive and propagated.[3][4][5] Misinformation can include inaccurate, incomplete, misleading, or false information as well as selective or half-truths.[6][7]
you're confusing it with disinformation
correcting me? can i not think of things in my own way
are you actually trolling?
do you know what 128-bit mode is called
its called internet security
no im referring to x86-128
do you know what that mode is called
oh thats just a better 64 bit
Yeah but what is it called
EXTRA LONG MODE
no
Wrong
it's called 12-wedding-cakes mode
^
what is going on?
guys im a bit out of touch
what happened here
@odd maple hes dm'ing me saying you banned him for trolling
im so confused rn
he was trolling
yes he got banned
tell him to DM me under "lukflug"
my DMs are open
I did
yeah
if he disagrees, he can dm me or lukflug
told him
what exactly was he trolling about
i dont know about modes too much and im reading the intel manual which i got
so i cant comment ig
i just read chat history
this
wait there isnt a real mode in i686
i686 either refers to an instruction set, namely the instruction set of the Pentium Pro, or a generation or set of processors which have the capabilities of the Pentium Pro.
There is no such thing as "i686 mode". There's real mode, and there's protected mode, which was introduced with the 286. The 386 introduced 32-bit registers, which can be used in either mode. In addition, it added certain flags to segment registers, allowing for 32-bit code segments, where 32-bit registers and effective addresses are used by default, and 16-bit registers and effective addresses require a prefix. In the previous 16-bit mode, it's the other way around, 32-bit requires a prefix. In particular you can have both 16-bit and 32-bit segments in both real mode and protected mode. In real mode, it's 16-bit by default, and you can change it to 32-bit using some trickery. In protected mode, it's determined by GDT and LDT entries, where 16-bit and 32-bit segments can exist side-by-side.
16-bit and 32-bit mode just refer to which code segment happens to be loaded.
The 386 also introduce virtual 8086 mode, where you can have segments behave similar to how they would under real mode, if you set a bit in the flags register (which usually can only be done through hardware task switching). The 386 also introduced optional paging in protected mode.
he said that in markos thread too
you're thinking of protected mode
i686 is an instruction set
In particular, the 486, Pentium, and Pentium Pro are not that different in terms of the available modes. The only difference is that they introduced additional settings to paging.
ohhh damn
Like write protection, large pages, global pages, PAE, and PSE-36.
why would you want real mode tho like what do you get free from real mode
Well, that's why no modern OS uses real mode.
they are all protected mode?
pmode is pretty dead too
ability to use BIOS interrupts, faster memory access somewhat
all new shit goes long mode
you only have 1mb of ram though unless you do some shit with segments
should i switch antini to 64 bit
yes
your choice
yes
but ill have to build a cross compiler again 😭
idk strip out stdlibs
you don't even need to build a cross compiler for that
skill issue
enjoy
NOOO
im staying with grub till i die
bad idea
i mean at some point ill add it in my makefile to support limine templates but not now
Then, with x86-64, long mode was introduced. Everything that existed before is now grouped under legacy mode.
Long mode has a similar thing to protected mode, where code segments can be 16-bit, 32-bit, or 64-bit.
Under 64-bit mode, segmentation is largely ignored. But you can also have 16-bit and 32-bit code segments, which allow for old 16-bit and 32-bit code to run under long mode.
Those are called 16-bit and 32-bit compatibility mode.
limine can boot multiboot kernels btw
So therefore don't talk in terms of 16-bit, 32-bit, and 64-bit modes.
also im primary cpp dev, mainly because of how it handles char pointers far better than C but whatever
First, because there's pure 16-bit protected mode.
but the limine boot protocol drops you in long mode directly
there's a C++ template too iirc
And secondly, long mode has 16-bit and 32-bit compatibility modes as well!
ik thats why i will add it later
So 64-bit mode is a term that isn't the same thing as long mode.
The Intel SDM calls long mode "IA-32e mode"
@odd maple you got any GDT references by any chance where it is actually documented for relatively new coders
yes
the Intel SDM
ive been watching this on loop for like 4 hrs https://www.youtube.com/watch?v=pfWjteMpcxE&list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M&index=5
▶ All videos: https://www.youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M
▶ Sources https://github.com/AlgorithMan-de/wyoos/commits/master
I show you how to set up a Global Descriptor Table, which is a prerequisite of setting up the Interrupt Descriptor Table, through which you receive data from your hardware.
ill probably start with getting 64 bit gcc
@odd maple frickin linker
show the source
makefile?
give github or soemthing with the stuff on it
its on github ill just push the new makefile
gimme a sec
aight
also github is somewhere above in the start of the thread
synced
latest report : rebuilding cross compiler with x86_64-elf target
and retrying the whole code
Wait
My makefile will be edited.
And there will be a switch between grub and limine
PROTOCOL=multiboot
And multiboot2
Right?
@full bramble sorry for ping, is this the way to boot a multiboot kernel?
well im having some issues with multiboot
im able to build the bin file
but its terribly hard to make it work with grub
you have a x86_64 compatible grub.cfg?
@queen compass
Wdym
you using grub or limine?
Grub
whats your grub.cfg
oh right
For 64
You can just boot the 32-bit assembly which starts 64-bit long mode
I dont see why u would need another grub.cfg for that
nah it doesnt work
grub is also telling that it cant find valid multiboot header
Do ya have the header in there?
i dont think so
Well blud
i just picked the default files from 32 bit osdev sample
Yeah
i will break a shit ton of things if i tried to write a new one
And do you have the hdr in the boot.s
idk havent looked at it
menuentry "AntiniOS" {
multiboot2 /boot/AntiniOS.bin
}
Try just multiboot
yeah i need to get a loader.bin
Since the default files use multiboot
it says multiboot header isnt found
Not multiboot2
Then switch ur hdr too
Yk, funny thing, to get that you can just compile boot.s
loader.o
@full bramble switching to limine 🥳 (i am not spending 7 hrs to debug this shit)
or i might spend 7 hrs to debug this shit
cuz i plan to make it actually good
idk
lol
how does using limine make it not "actually good"
i thought the same befor but im enlightened now
limine is fkin awesome
im just not sure what KASLR means but ig ill keep it
its very similar to normal ASLR
oh so its a fork
lol
ig ill keep it for debugs
it randomizes where things appear when you kernel is loaded
what
iirc its the hhdm base, and the kernel binary (if its relocatable)
fork of the normal ASLR?
its a memory safe way to debug kernels?
as in prevents memory corruption
no to both
A quick google lookup would have told you it stands for address space layout randomization
ok wait it works now
it generates a bin file finally
now its time to automate limine process
@full bramble u really should disable ASLR by default because it confuses the shit out of people 
it isnt enabled by default
its just a default separate boot option
the regular is KASLR disabled
Yeah it isn’t
But the template project kinda „promotes“ it
Iirc it’s on the first entry, but I may be wrong here?
yeah the regular one with KASLR disabled is first
the second one is KASLR enabled
@odd maple idk whats with limine but its just not loading things properly
yeah thats what i thought too
but i do indeed have the files setup exactly how limine specifies
infact theres not a single build error
i have the file in /boot/limine/limine-bios.sys
as its recommended
but i have tried moving it to /boot or /limine
ill push the code wait a sec
are you not using the makefile that came with the template?
nope
no that works perfectly fine
infact i was comparing both the template's makefile and mine
then compare both and see where the difference lies
yeah i was doing that
nowhere... actually
atleast in the .iso section which the default make runs
i pushed the code
Also I’m outside for a bit so I’ll be back to my desktop later
well i already did put it as the second boot entry in the template
a few days ago
the other alternative is removing it entirely
lol
@full bramble sry for the ping but you got any solution
this issue ^
you've probably screwed up the build system by attempting to remake it
nope
i do get a peculiar error msg
xorriso : WARNING : EFI boot equipment is provided but no directory /EFI/BOOT
xorriso : WARNING : will emerge in the ISO filesystem.
i mean its a warning
but i can assure you the error is somewhere here
i dunno how to avoid it
does anyone know how to set the directory
for xorriso
like root iso dir
heres my xorriso cluster command
it just sets the root dir to the repo source dir (aka repo root dir)
i wouldnt say source since src is a separate folder but you get the point
it should be in limine_building/iso/
thats where everything is copied
lmao my answer was in my question
i just had to change . to iso dir
damn i just spent 5 hrs on this issue
wait why isnt it running
oh right
new function nvm
ouch
nah im used to it now
btw is there any good like terminal
handlers
or like things to control the limine framebuffer
since i have no idea how to
ArgumentError
Tag not found.
But you can also write your own
i heard it somewhere
wait hold on
what does it have
like just write functions or like full blown color management and everything
also any bold support? 🥹
is it like ANSI codes
i hope it is lol it would make the task so much easier
Yeah
it does not do bold
by actually bolding
it changes the colours to be bright though iirc
which is what a lot of other terminals do as well
How does one mess up this badly
It‘s a single init function and then calls to write()
see thats the thing
im trying to port the code to cpp
dont want any C code in the project 🤷🏻♂️
porting c code to c++ has never been done before
cuz it isnt porting really
most c code is just c++ code indirectly
what's wrong with that
idk i just feel the need for cpp being everywhere
idk the github stats showing C code just triggers me lol
nothing wrong with that again
You dont even need to have flanterm in your codebase
Just download the source code at build time or use a git submodule or something
right ok
@odd maple not too sure what im doing now but i just cloned flanterm freshly and the code is causing compile issues
fresh code straight from source
well, maybe don't crop out part of the error message
^
btw i did solve most of these errors when i converted them to c++ and casted different types, the label one is still there tho
why the hell are u compiling C as C++
are you literally including a .c file in a .cpp?
are you compiling C source files as C++?
cuz under C void* conversion shouldn't be an error
no..
he litearlly did
#include <flanterm.c>
OMFG
huh no?
least insane flanterm user
🤦♂️
that's not much better
omfg
sorry
my patience has been relatively low lately
how about u learn how C/++ works
yeah im fine with being rude and all but like just please explain tf i am doing cuz im off scope rn too
....what?
why are you including a source file in another source file?
especially a C source file into a C++ source file?
why not compile the C source file in a separate translation unit
oh cuz its far easy to link one file
as actual C, and not C++
than separate files
I suggest you go learn C and C++
Wtf
like
ig ill just build it separate
i just cloned flanterm freshly and the code is causing compile issues
you didn't
this is why osdev says 10 years of experience needed
you clearly modified the build system
or well
how the build system in the Limine C Template is intended to work
yeah, it's a bit over the top
but it's kinda true
i did.... infact i have a distclean that i run too to remove the source files
of flanterm
do u still not understand what u did wrong?
i linked a cpp file in c file
ik
im trying to compile it separately and link them together
linked?
idk you tell me what to do
do u know what the include directive does?
I guess there's two things:
- you need enough programming experience to immediately and intuitively understand how hierarchical page tables, like those in x86, work
- you need enough experience with C to know how a project is typically structured (i.e. header and translation unit conventions, how the linkage works, etc ...)
yes it just puts the source into the original file
can you see how this just can't work
all other problem aside, one file is supposed to be C, the other file is supposed to be C++
you can't compile them in the same translation unit
you can't compile it as C, cuz C++ features would be missing
you can't compile it as C++, cuz no automatic void * conversion
Not only that
The goto skips variable 'constructors'
Thats not allowed
It isnt even that hard to add a rule in the makefile to build .c files with gcc and .cpp files with g++
Cant think of anything more trivial
Correctly including header files maybe
i did manage to edit the code for that but i did fail trying to get goto working cuz of skipping constructors so thats why im trying this approach now
im not sure how to include flanterm in kernel tho
so like separately with gcc?
yes
separate .o files?
yes
how would i use that in my kernel then
like every sane C/C++ project does
with the linker
you pass all .o files to the linker
yeah but then like it doesnt go past compilation
for kernel
?
how to include the files in kernel 💀
or atleast how to use flanterm in kernel
like you would for any other thing
include the headers in each translation unit where the definition is used
compile every translation unit
and then link the resulting object files
#include "flanterm.h" doesnt work cuz compilation
im putting the flanterm source code in separate dir aside from the kernel src
compiling it separately
but as 1 .o file
i mean 2, one for flanterm, the other for kernel
so
you can still include the header
that's what the header is for
to be included in every translation unit
idk is this correct
may i ask how long you've been a programmer?
this is not how makefiles are suposed to work
just use the Limine C Template
for the love of god
well
you need to add rules for C++
but you can just copy and paste the rules for .c files
6 years tho low level only 1
how long with C/C++?
yeah 1 year
uhh..
You sure
have you ever done a project that involved more than one translation unit?
nope since i just put everything into a single file
How many lines are we talking
ok, then I suggest taking a step back
and learning more about C or C++
wdym? overall?
before engaging in such an endeavor
in a single project
In these single file projects
i never try to run C code in C++ ever, thats why i was trying to port flanterm code to cpp, it almost worked but only the goto parts failed
compile them separately
^
around 900 lines max per file, its not 1 file, but all other files are just put under 1 main file
you cannot expect to do an entire kernel in a single source file
How did you manage to avoud having to compile stuff properly for that long
i dont expect to, i just prefer it, i do it if i can...
This isn’t about preference
idk everything under one main file
i think the -x c flag does compile certain files under different translation units so thats why i used it
no no no no
but have you ever tried the alternative, before choosing this "preference"?
i mean separately
you need separate compiler invokations
to produce separate outputs
to be linked together later on
ok, nvm
you can actually do it in a single invokation
still, I'd do it in two invokations
and as separate recipes
well in that case how should i include it in my kernel
linking
just this?
but... i have to get pass the compilation point to get to linking
yes
or whatever the appropriate path is
you just include the header
then you compile them in separate compiler invokations
then you link them with the linker
the recipe for the kernel image should contain as dependencies the object files
and the recipe should be to link those object files and produce the image
the recipe for the object files should be the compiler invokation for each respective object file
like the source of the header? as in the place where i clone flanterm?
may i ask what's your project setup
like you did here
except without the .c files
the .c files are compiled separately
and then linked
check the github https://github.com/PratyushKing/AntiniOS
just updated rn
unrelated but why do you have VGA text mode files when you're gonna use flanterm
cuz im yet to remove them
its from when i used multiboot
ignore it for now 😅
fair
dont remove
Put them in a disabled dir or smth
In case u would want to switch back for some reason
no i wont + i perm deleted already 💀
isnt too hard tho, at most i just added casts thats it
and it wont work 100% due to the goto just not working
he wouldn't be able to
limine protocol never drops you into text mode iirc
im not going back
- i have removed the i686 cross-compiler
- i want to use x86_64
Um u can x86_64 with multiboot
no
multiboot doesnt support x86_64
even if it does its far more limited than using limine boot protcol
multiboot drops you to protected mode
not 64-bit mode
there's no benefit if you downgrade from limine
- limine just provides more features that'd make downgrading not worth it
unless you want x86... which you probably wont + limine boot protocol does support x86 i believe
no it doesn't
well in that case limine also has multiboot
the bootloader does though
yeah
yes but tbh it's not really worth it to support an older architecture
you're way better off just using the limine protocol
its sad to let grub go
cuz its a wreckin hell to get limine boot protocol on grub
i just really wanted grub themes
limine boot protocol... on grub...
Since when does grub support limine protocol
since never
It was more of a rhetorical question
it doesnt, thats the thing
and if you do you kinda have to manually build grub yourself to a point where all limine deps are satisfied
its possible, just next to impossible
it's GRUB, what do you expect
The power of Richard Stallman compels you ✝️
yeah, uh, no
wait no sorry
Oh yeah I'm feeling so so much more powerful right now!!! All glory to GRUB!!
huhhhhhh
its possible, maybe, but why?
yeah its like you almost add a layer of limine itself
grub themes, thats it 😅
you'd need to write shit for grub though, atp you might as well just write themes for limine
you're seeing your bootloader like for a second at best
i mean theres linux boot protocol tho,... at that point just fork linux i suppose
exactly
unless ur OS gets stuck in a bootloop xD
idk for me it is doing rn
this just doesnt work rn
wherever you go... whatever you do... you cannot get out of the cosmos curse
what?????????? this has nothing to do what I said
also im stuck with trying to link flanterm
yeah ik but its an option, its far different but it is... an option
not to mean its a good one but like sure
🤫
lol
maybe compile it as C file... and then... link it?
you see thats the thing... i have to somehow include/import it in my kernel too
with ld...
to include you just do #include "filepath"
see thats the thing lukflug told me too.... but i need to pass g++ for that
you are compiling flanterm with G++?
im doing just that, but i need to get this command functioning
^
dude it wasnt compiling then, it does now
read the args carefully
its not running under g++
make another recipe for the flanterm
i tried porting to c++ but goto statements didnt work cuz of constructors so...
and just do gcc there or whatever ur c compiler is
tf is that?
pro tip: more common names for COMPILER and COMPILER_FLAGS are CC and CFLAGS (or in your case, CXXFLAGS)
a separate command you mean?
flanterm:
gcc flanterm.c -o flanterm.o
......
and then you just link everything together
every object
yeah but still doesnt solve the original question
the kernel doesnt have access to flanterm
but... im compiling it separately...
brother 🙏 learn how compiling works
yes
it gets linked together later on
then link it together
with ld
tf will i do
do you know what compiling and linking are?
flanterm.h is not on src/flanterm.h then
dude... to the both of you, i have to compile first and then link it
ok you are stupid
if you're compiling them separately, i believe you can just extern void flanterm_init(); or whatever the flanterm functions are, and link everything together with ld in the end so it finds the references to the functions
im sorry to tell you this, but you should uhh learn how to code? before making a fucking kernel
and why does the cpp file have include guards 😭
LMAOO
where... am i doing that...
in the screenshot they just sent
brother look at the screenshot brother
src/console/terminal.cpp
dude that code is not in use... its completely separate, it was there for VGA testing
literally in the fucking screenshot
right yeah that was for temproary checking
@vale pebble my best tip for you right now:
Restart from scratch, clone the limine template AGAIN and begin from there.
also thats VGA code, when i was using multiboot
yeah but the fact you've done it even there shows you'll continue to do it anywhere else, and from what i saw you did
im not using limine template, if you look at my makefile its completely written from scratch
why????
linux coreutils for fun
limine template has everything working for you already
idk want to learn it maybe
i have...
that's not the way to learn it...
it's kinda like saying "i'll write my own bootloader to learn how an OS works"
um if you did you wouldn't be including a cpp file
and you wouldn't be putting include guards on a C++ SOURCE file
dude it was temproary, i didnt want to setup a hpp and cpp separately so i just did it for temp use
its not even being part of the source code rn
as in build process
its just there from when i used multiboot
yet to remove it
yeah cuz i didnt make hpp files yet.... it was just there... temporarily
"Ye shall learn proper C/C++ before doing kernels" ~ Misashi Miyamoto
🙏
🙏
the fun fact is that the C++ template already has it
all you need is to dump flanterm in and you're good to go
but someone removed fences, so...
how does that work
You keep being rude to everyone on cosmos lmao
Let’s say you’re getting a taste of your own medicine
im fine with it
i need knowledge > self-esteem on this server
🤷
also i dont really be rude
there are just a shit ton of newbies on the cosmos server
oh .. the irony
no actually, most people on the cosmos server dont even know how IL works
so you arent a newbie
what's IL?
oh
and you don't seem to know basic C/C++ conventions
and how the compiler and linker works
Because IL isn’t needed to be known
also known as CIL, MSIL, etc...