#💽Programming Chat v2
1 messages · Page 26 of 1
it's probably an issue with memcpy again
but then if you just ignore the interrupt
one simple trick OS designers don’t want you to know
yeah i tried adding a basic IVT
it didnt' work
it just threw a gpf while trying to write to 0x0
i'll just defer that to protected mode and use an IDT
Gotta be in ring zero silly
what do you think real mode is 😭
also technically since im memcpying acpi i can overwrite that data without any issues
the issue is its in the BDA or EBDA (both of which could do bad things since SMM also uses that memory)
hm,mm
im not very well versed in allocator design so
would a compacting gc > a fragmented linked list
.section .text
.globl _memcpy
# void *memcpy(void *dest, const void *src, size_t n)
_memcpy:
pushl %ebp
movl %esp, %ebp
pushl %esi
pushl %edi
# Load the arguments
movl 8(%ebp), %edi # dest
movl 12(%ebp), %esi # src
movl 16(%ebp), %ecx # n
# Copy the bytes
rep movsb
# Restore the registers and return
popl %edi
popl %esi
popl %ebp
ret
memcpy 
function Copy_Bytes
(To, From : Address;
Length : Integer_Address)
return Address is
From_Chunk : Chunk (1 .. Length) with Address => From;
To_Chunk : Chunk (1 .. Length) with Address => To;
begin
for Index in 1 .. Length loop
To_Chunk (Index) := From_Chunk (Index);
end loop;
return To;
end Copy_Bytes;
i could probably do To_Chunk (1..Length) := From_Chunk (...)
use std::arch::asm;
pub unsafe fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8 {
let mut edi: *mut u8 = dest;
let mut esi: *const u8 = src;
let mut ecx: usize = n;
asm!(
"rep movsb",
inout("edi") edi => _,
in("esi") esi,
in("ecx") ecx,
options(nostack, preserves_flags)
);
dest
}
(idk if this will work, blame claude ai)
memmove
well gotta write a new function where i have to guess the signature
no but theres a possibility of it being defined by gnat over c
yall need #[no_mangle] fr
we don't mangle functions
let me try void *memmove(void *dest, const void *src, size_t n)
would probably be prefixed like __gnat_ though
why do you even have to do that
wdym
like why are you having to guess these functions
they're internal functions
ok but you're literally writing a kernel
yeah but the alternative is reading GCC source code
the alternative is write some assembly no?
💀
cause you're not linking to any libraries
i hate assembly!!!!!!!!!!!!!!!!
get ai to do it for you...
ew
or just like idk
the rtl is technically a library but im also writing that
write a function in ada that works...
me when I define you as a compiler intrinsic
oooo x86 assembly 👻
at&t syntax 👻
gcc inline asm uses at&t by default yes
can actually just use my new functions for out/in since those are inlined
andb reaction
alright there
hey guys..
what do you think of my revolutionary npm package
i didnt see any other package that does this
could try an optimization likw movsd and div length by 4 but
sooooo
might not outweigh the gains
package name looks like a virus
thread locked
asked to leave node
okay
reading the bayachao wiki was a mistake
lol wut
man
im stuck just looking at it 😭
i cant bring myself to wrok on it
launch the shell
LAUNCH THE SHELL!!!
I NEED TO FINISH THE ACPI DRIVER THEN THE USB DRIVER THEN THE PS/2 DRIVEr
then FINISH
i made a tiny kernal that just polled inputs but
im pretty sure i deleted it a whiel ago...
do
it
do it
ugughughuguhguuhg
check_exception old: 0x8 new 0xd
my mouse is dying
brb
mouse is alive
lemme look at more bayachao art before continunign
oh
thats what makes it fun
edited
nuh uh
get outttt
clipboard is stuck
yknow bayachao draws A LOT of other stuff aswell so
just let me know if i send something bad unintentionally
just dont smhh
“dumbass bastard” being gimp is so accurate




yuuurrr
I HAVE HEADPHONES AGAIN
‼️
i'm using a stupidly low power rtansmitter for it though
im dealing with RF that can be blocked by my hair 😭
crazy
everything that can be Pure is Pure, everything that can't is Preelaborate, or at least, No_Elaboration_Code_All
Pure : Package has no side-effects
Preelaborate : Package will not execute code at elaboration time
No_Elaboration_Code(_All) : No package elaboration code will be generated
i can do that???
*A special case recognized by the compiler is the specification of a Storage_Size of zero for an access type. This means that no items can be allocated from the pool, and this is recognized at compile time, and all the overhead normally associated with maintaining a fixed size storage pool is eliminated. *
I hope someone from RUSTSEC takes another look at if it was such a great idea to issue an advisory against an unmaintained YAML crate. Since then, the state of the ecosystem in practice is much worse, now with AI slop. https://x.com/davidtolnay/status/1883906113428676938
(And yes, I'm part of this problem because in a crate where I did not want...
hmm
i could probably get away without allocators by doing this
not sure how though, like casting an Address to an access?
this ada stuff is complex
llama 3.2
I have a rtx 2050 and it generates nearly instantaneously
for some reason ollama uses like 200 megabytes of ram so I keep having t oturn it off when im not using it
and it doesnt work if I use it when its not on through systemctl
i think this is roughly equivlent to casting a C void* pointer to x*
well okay
kinda
Address -> PC -> Ptr is more like casting an int to x*
got them into a discriminated enum
which meannnnnsss
i can make it a variant record! without any heap allocations!
memcmp
I hate debugging asm
nice
rep memcmp meanwhile (its slow asf)
why tf does intel let instructions get slow
why do they make instructions that are slow
i read that with movs too
apparently they let it get really slow but then sped it up again
theres also the loop instruction
now its fast* (a CPUID bit determines if its optimized or not)
its literally just cmp rdi, x jx y and its slower than actually doing cmp rdi, x
wow
I swear intel should make a fuckin
okay ARM
even though ARM and x86 are roughly equal in complexity today...
bro they should make x86 more complex and faster
they should just give us microcode programming
true
lol
computers were fast before microcode!!! raah
super x86 mode isnt made with microcode so its very very fast fr fr
yeah well now there's like 500 different chips inside a bigger chip controlling what an instruction actually is
fuck modern computers
The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor. A CU typically uses a binary decoder to convert coded instructions into timing and control signals that direct the operation of the other units (memory, arithmetic logic unit and input and output devices, etc.).
Most co...
this looks kinda like that
yea
it is that
thats how you make cpu's fr
all the old cpu's are made like that
instead of having a miccrocode or proccessing or shit they just run the instructions no extra complexity or anything
by old I mean like <1990 old
; eax = lba
; ecx = ammount of sectors
; edi = to
; converted to int 13h so accuracy is lost idk. uses tempsector and memcopies to
; trashes everything
.loopreadlba:
pop eax
inc eax
dec ecx
readlba:
push eax
push edi
push ecx
.h: hlt
jmp .h
mov ecx, 64
div ecx
mov cl, dl
mov ch, al
mov bx, 500h ; temporary storage
mov al, 1
xor dh, dh
mov dl, byte [discsave]
mov ah, 2h
int 13h
pop ecx
pop edi
mov ebx, 500h
.loopnxt:
mov dl, byte [ebx]
mov byte [edi], dl
inc ebx
inc edi
cmp ebx, 0x700
jne .loopnxt
cmp ecx, 0
jg readlba ; loop through every sector
ret```
fuck me
the hlt loop is for debugging
.loopnxt is a memcopy
i just realized i just made println debugging first thing in my kernel 😭
still need 2 write a serial adapter
reading this tweet from my backburner
im not gonna bother with serial
im just gonna go straight to keyboard and amd integrated modesetting
(im gonna cry trying to write a diver for amd)
if you want to be super lazy just poll ps/2
The generated function returns a Result containing the field value as a String, or a Box<dyn std::error::Error> if an error occurs.
im not a rust user but
Box<dyn std::error::Error> doesn't sound right
uhh bascially a function that can error returns a container with an enum inside of it
which can either be "good" for your actual data or "bad" for the problem
i'm sure it's as fast as the C style of it
slower than setting a flag lol
yea
how tf
did my fucking
code freeze
in the fucking bios
did you overwrite a part of bios data or something
lmao we looking at the same website
yeah
I hate debugging assembly 😭
im gonna make my own fuckin language that will happily compile to 512 bytes I swear to god
wait
iiii need to update my malloc function
it's gonna overwrite the kernel
ill just set the heap addr to 00000500
surprised 'Valid works this well without a stdlib
200mb is nothing
But duly noted
aagghh
discriminant in constraint must appear alone my behated
i don't like this but it has to be done
nice
now i gotta write it for 64 bit!!!
neat
got a full console
this marks ACPI reading complete
since this is really all i need
store all the lines in a file
there is no filesystem yet
already have a spec for that actually
cause gluten is the structure of bread
i imagine it won't be very performant though
since it relys on expansiveness
e.g. file metadata starts out using ints, but if higher precision is required, longs, long longs, big ints...
a LOT of our stuff relys on expansiveness actually
we just really like infinite precision
its alot for me 😭
yay
Channel 1 is unusable, and may not even exist.
bruh
my thing isnt even reading
any data
why
oh its giving me an error
nice
the error code is one
bruh
INVALID COMMAND
WHAT!?!?
it all looks perfect 😭
I downloaded ollama and ran llama3.2 w/ 3b tokens
honestly neat
fairly snappy
500mb ram
I think I got a higher one
2060 super so the util jumped to like 85% mid-response but still snappy
I wish llama was kinda better
and used opencl
it will only work if youve got a gpu with enough ram
it wont try any paging getup or shit
use uh deepseek ¯_(ツ)_/¯
and it straightup wont worko n anything that isnt cuda
no im talking about the tooll
not the model
llama3.2 is my favorite liek I told you 😭
ollama or llama3.2
ollama the tool
this is gonna be painful
i have a pc speaker in mine rn
ah ic ic
and another one with pc speaker emulator
i bought a pack of 50 for like $3
ah
naw im too lazy
also deepseek-v3 is 404gb 😭
mine are just soldered to a header of 4
yeah tahts what im talking about with ram
ram or vram
you cant just get a fast ssd and have a fuck ton of ram
then throw cpu at the motherfucker
but probably need a lot of vram too
you haved to have enough ram to hold the entire model
ram or vram
man I want 128 gigabytes
if its running on the gpu it wont work if you dont have enough vram on the gpu
the larger download the larger cap but its still a cap
to download a model
look at it
download a big model
then see its suspiciously locked at a thing
like its a pretty generous cap but its a cap nonetheless
and this is all free open software they should just torrent it 💀
1.5b is kinda shit
I prompt it then it is still stuck on when I said hello 5 minutes
lol what mine is fine
😭
well ok
it responds
but
i tried asking it a logic question and it didn't do anything lol
like it said "this is out of my current capabilities"
lmao
but I asked it on the actual deepseek website
and it thought for a whole ass minute lol
could try the 7b model
wont run on my pc
I dont have enough ram
well im gonna try it and see if I was lying about the no paging thing earlier
omg my internet is slow 😭
ill see you in a few years
and the new one with beep is also pretty loud
now play music
i think i can
but i need to figure out how to read files first
im just gonna attach this to the printing functions
its working for me
i really need to figure out how to impl IRQs without it causing a segfault
RTC is great but it only works on one vm platform and has a deadful 1000ms resoution
dam
91% util lmfao
yeah my gpu was going like
1 word half a secon
It's a little slower than llama3.2 3b but not very noticeably
yes
I love it
banger
bro has done all of this while im still working on a disc read function 😭
dw im catching up to that
well IT KEEPS GIVING ME AN ERROR
😭
im so mad at it
cuz im looking at the registers and everything looks perfect
oh nice its not erroing anymore
and its fucking stuck again 😭
what teh fuck did i do to get the error 😭
only one com channel and its already 50% of my entire low level pin enum
woah it actually wokrs the first few times yay
dyamn
now im reverting to old versions and it doesnt work
WHY TEH FUCK
IS IT NOT WORKING
readlba:
; eax (lba) to ecx (chs) only cylinder and sector
xor edx,edx
mov ecx, 64
div ecx
mov cl, dl
shr eax, 2
and eax, 0xC0
mov ch, al
inc cl
xor eax, eax
xor edx, edx
mov ebx, 0x500
mov dl, 0x80
mov ah, 2
mov al, 1
int 13h
jz err
ret```
and its not working like at all
even a commit from when it worked doesnt work anymore
bruh I was checking jz instead of jc
STILL ERROR
what teh fuck man
all the registers look good
its reset
I hate this I hate this
oh this is cool
oh hey this worked
for some reason it was erroring on a specific sector
bruh
why is it a random value now
it wont read the first sector
why
and now it doesnt work but is still giving me an error?
lmao
well now instead of giving an error it wont read the sector at all
the working commit doesnt work!?!??!
@proud creek
something..
lmao
i don't know yet
i was just stepping through the serial writer cause it looked like that was the issue
but something in RTC is bugging out
gfg
bad game
obligatory “if you had written it in Rust…”
well you see
the RTC uses assembly
and no language can really be used there aside from it
thats what im doing
im pretty sure whatever inline assembly is being used is not being contained safely
Yeah so
Write some high level language code
Generate assembly from it
Use that generated assembly instead
oh you're saying use objdump
No I’m saying gcc -S
@pastel tinsel https://x.com/nathan_covey/status/1883881019356631214
typical ada user preferring the more verbose answer
its not verbose if its already done for me ...
you don’t understand
isn't that how all ai works
pretty mych
you: "oh my hand-written assembly memcpy is broken"
steps:
nano my_memcpy.c- create memcpy in C
gcc -S my_memcpy.c- Copy from generated assembly and paste into rts
okay but why not just
because this isn't isn't within a complete file of assembly
it's a bunch of small in/outs which are inlined
it's easier to just look at the completely disassembled function w/ the inlined code at least for me
687
i can count
x86 isnt real
NO
NO WAY ITS A MEMMOVE ISSUE
wait no i just used c
fml
okay it crashes here
the first exception is "INVALID_OPCODE" so
hmm
i think i need to tell it not to vectorize
looks like that fixed it
aha
that also fixed the 15+ byte crashes on strings!
so im NOT a bad coder
I am 😭
I literally plugged in the registers manually
and it STILL ERROR'S
like
im pretty sure its a problem with qemu now
probably is
i was gonna ask if you've tested it on other vms
cause there can be a lot of diff behaviors
yea
im gonna try it with different accelerators first because theres no fuckin way its a problem with qemu
bruh it works with qemu+kvm but not just normal qemu
thank god im no longer limited
wait were you using like xmm registers for strings somehow
yeah GCC was trying to use xmm for large (15+ bytes) string concat
dyamn
since i haven't added CPUID yet, kernel doesn't know my qemu doesn't support fp so
it goes kaboom
waa
fr
why does it haved to be
like
increments of 16
and its such a cool idea then they plaster it and throw it away in even protected mode
im such a good programmer fr
alright
i think this is good enough
changed 0x107DFE to 0x007DFE and yup
shocking
oh right
gotta clobber the flags since TEST sets ZF
Resource Interchange File Format (RIFF) is a generic file container format for storing data in tagged chunks. It is primarily used for audio and video, though it can be used for arbitrary data.
The Microsoft implementation is mostly known through container formats like AVI, ANI and WAV, which use RIFF as their basis.
Waveform Audio File Format (WAVE, or WAV due to its filename extension; pronounced or ) is an audio file format standard for storing an audio bitstream on personal computers. The format was developed and published for the first time in 1991 by IBM and Microsoft. It is the main format used on Microsoft Windows systems for uncompressed audio. Th...
TODO
おきつねマンガ描きました
GJ that’s grammatically correct
:3 33 3 33 33 33 3 3
that was written by bayachao silly
o lmao
anyways GDT is still beating my ass
and ive made this strange type to cap them
I must say for your sake
Bayachao didn’t write a 100% grammatically correct sentence
oh my god
It’s common to omit some particles and bayachao omitted one, which while technically not wrong isn’t completely right either
keep talking i've jusut got an idedae i need to write down
For your sake you need to know
The completely correct sentence would be
おきつねマンガ**を**描きました
The を explicitly denotes the direct object
But it’s common to omit that particle especially when speaking more casually
noted noted
sorry i just got reminded of the book you sent i have sitting in downloads i haven't read yet due to kernel stuff
i wanna try reading it on my kernel
aw crap i gotta do art stuff for modding soon
the book?
AAAASS
i dont have high hopes for this code
but here goes nothing
seems to have worked?
lemme add a divide by zero
uhmmm
it should've written an excception..
i guess not
GDT= 00000500 00000020
hey!!!
it worked!!!
by default it'd be
GDT= 00000000 00000000
idk what to name it
since it's ... far
no exceptions thankfully
update i forgot to actually run the code
uh oh!!!
ohh
it wants a SELECTOR
not an address
hm
so for some reason the reloading is causing a segment not present exception
but the GDT is being implemented and read fine
an @spare quartz database?
Airline Transport Pilot (ATP) Certification is the highest achievement of pilot certification, requiring 1500 hours of total flight time. Pilots with an ATP certificate are eligible to fly for an airline, will meet the hiring minimums of most regional airline pilot jobs, and also qualify for a wide arrary of pilot job opportunities with various ...
go to my school
ooowwwwwwwww
okay soooo
0 00 xxxxxxxxxxxxx ...
hmm
i should just shift it to the .... left? 3 bits?
no that didnt owrk
私あなたを殺す!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ええ、きみ!!!!!!!!!!!!!!
i understand why the interrupts were failing last time now
i was in protected mode implicitly by the BIOS, which doesn't support the IVT
Intermediate value theorem?!?!
idk what that is nerd
Learn calculus smh
average idt behavior
私は smh
You could also omit that entirely and leave it inferred that you will be doing the killing
I GOT INTERRUPTS ACTUALLY WORKING :3
rn it goes into a trap handler which is bad but im gonna try to fix that
One interrupt handler:
print("Silly, we don’t do interrupts here!!") and exit
i wish it worked like that
these are super sensitive
printing causes the IP to totally shit itself
and by the end of the handler ... its at the bootloader
Yeah cause printing needs an IO interrupt 
so just return before then silly
printing doesn't need any cpu I/O ops
doesn't work
on the INTERRUPT ISRs iret does do something ... but it throws a GPF afterwards (probably not accounting for a datum)
iret?
oh ic
default_interrupt_handler applies to ALL interrupts which is why it hlts instead of iret
no_op does the same cause i cant return not knowing whats on the stack
A set of tutorials (notes) organized as a book that explore how to write an Operating System from scratch
Read the bottom of that image
ah, probably need a popw
i was using pop already, but i guess NASM didn't insert the right operand size of it
probably was inserting a popd or popb
this should be good
oh right
I think you wanna pop and then popw
INTERRUPT isrs don't push an error code so not needed
its just the vector number
well if you wanted to do it in the correct order
oh i see what you mean
esp in this case but yeah
awit
ughgugh
don't need the pop
ignore me im a little stupid sometimes
check_exception old: 0xffffffff new 0xd
1: v=0d e=f9ec
gpf..
hold on
making a pr
*Before the ret, this code is executed, to tell the PIC that it's OK to send any new or pending interrupts, because the current one is done. The PIC doesn't send any more interrupts until the cpu acknowledges the interrupt: *
okay so theres still a gpf in no_op
gonna go into gdb and check out why
BUT FIRST
makefile modfiications
🤓
You mean BEAUTIFUL
❌
makefile ❤️
uhhhgh
is there a way to make qemu run
but NOT wait for it to exit
and jump into gdb
qemu-system-i386: -g -d: Option not supported for this target
-s or -S by bad
Yeah so you have to use -s
i am
And then gdb attach
Yeah it just backgrounds the qemu process
you can get it into the foreground with fg
nice
yay it even runs the remote well
just need to make it go into layout asm too
GNU needs their own executable format called GNOME
GNU NOrmalized Multipurpose Executable
OK
note to self
REDIRECT QEMU TO A FILE
god gdb is so easy to segfault its insane
its gdb segfaulting so yeah i'm sure
like i can just unhook qemu, run it again, target remote and it has a 50% chance of segfaulting
making me have to do file, remote, layout, break all over again
how else do i reload it 😭😭 its locking me filse...
u press C to continue duh
no but if it’s locking you out
YOU'RE an l
NO
my kernel won't have fs locks 😎 itll uhmm
itll do the presidential elections everytime a handle is aquired
Hell naw your computer gonna vote for Trump
no cause you cheated with multiboot & grub
HOLD ON
IM PLAYING A BAYACHAO GAME
.... that i pirated cause i cant afford it :<
make ur own bootloader u cant afford multiboot or grub
but grub is free 🥺
ugfghuguhguuh
it uses japanese words even in the translated version!!!
oh yeah
everyone hates me in this game :<
TRUE @pastel tinsel
@pastel tinsel (or anyone else who knows) what's the name of that one open source service to make online documentation for your projects
like for code and shit
read the docs
that's semi paid its not that one
vitepress
its open source
i could also recommend gnatdoc but... thats not applicable to you!
average ada tooling that isn't used by more than 2 people
i think this is what i was looking for
maybe
im not sure we'll see
its good tooling!
looks similar to docusaurus (but imo better)
There’s a lot of them
:33333333333
i finished it
its a nice game
Awesome job Nirre and Acid Usagi. And keep on Theorizing Mat Pat. You both are extremely awesome! =D
Original Creators: Nirre &Acid Usagi.
Song Name: Science Blaster
Used in: Game Theory 2016 Intro
HOLD THIS
@spare quartz a you database
aera already sent this doofus
die
@proud creek here for posterity
smh
@spare quartz yo did you see that F-35 that crashed in Alaska
I just saw a video about that now
yeah i spoke to aera about it earlier today
up above?
in dms
oh alr
commander of the division for the fighter jet came out and said it was some in-flight malfunction
during the landing
pilot ejected safely but... idk what made it fail so weirdly
ye looked like it was just doing like in place rolls and falling
thats so weird lol
its like it wasn't flying
and just falling instead
you can hear it
ig we'll find out sometime in the future
its just a scratch
obv not the original jet since it was probably totally obliterated but
funny image nonetheless
if it was a programming issue i blame it on C/C++
should've used SPARK
disaster
well glad everyone is ok
super interested to find out more when that comes out
not the engineers 👍
LOL
well actually one set of engineers is happy
but idk how much we'll get so
the people who made the ejection seat get to increment a counter
theres prob one set of engineers that found this bug but got ignored
oh yea, that too
gotta say they have pride in this work
honestly if it is a software bug
i wonder how they push these updates out
the computers they use on jets is super weird
(and relatively limited since they're shielded + from ~2006)
have they upped this number yet
their twitter account did
yea I wonder how they enforce everyone update versions
actually idek how their versioning works
or if theres versioning
honestly wish i could buy one of those seats w/o the rocket booster
looks comfy
some replicas come in at thousands though
the idea of a "Firmware update available. Update?" and "Do not power off the engines." is funny to me
they probably just flash them though
LOL
do not unplug jet from ground power until the update is complete
lmfao I watched DeepSeek get censored in real time
I turned on the thinking model and saw it mention something about Taiwan during the thinking
yeah I’ve had it do that a lot
and it was mid-response when it suddenly got censored lmao
augh deepseek ddos moment
cmonnnn
@spare quartz it's getting ddosed 
local model :3c
ughhh I don't wanna turn my windows pc back on
and my macbook absolutely fucking chugs cause it has no decent gpu
Well
google gemini it is
ok but ur laptop has gpu
and you're running a model on your phone?
or do you have an interface b/t your phone and pc
it's down for me
website inf loading type deal
Yeah for me it loads fine
Occasionally it drops out mid req but
Overall it can think
either that or I have been disconnected from deepseek by the CCP
Ooooookay
It dropped for me too
🙏
OpenAI is really trying to make their money count
Wa…ta…shi
What is it
SIGHHH
私

