esolangs & os dev
Started by kalucky0718 repliesLocked
- K01:52@gudenau hello there
- N
- K
- G
- N
- G02:12Isn't that JS?
- K02:15all cool kids are now making their own oses
- G
- G
- K
- K
- N11:12a template for osdev
- K
- N
- K
- G14:29MikeOS
- K
- K16:11but i still have
DOUBLE FAULTwhatever the fuck that means - G17:33What mode are you in?
- K
- G
- K
- G
- K
- K
- G
- K
- G
- K
- G
- K
- N
- K22:34How do I use it xd
- N22:35At least that's how I debug
- K22:36But it doesn't help with DOUBLE FAULT
- N
- K
- N
- K
- N
- K
- N22:44I thought you meant like comment doc
- K22:57This line
- K
- K
- G23:50You are in protected or long mode and don't have an IDT.
- K
- K
- N
- K
- N
- K
- N17:49Pressed enter early
- K
- N
Replying tokalucky0https://cdn.discordapp.com/attachments/659572602825605146/905493866784890880/unknown.png
Ooh is that linux - K
- N
- K17:53It's GTK
- K
- N18:41Isn't gnome Linux only
- K
- N18:57That's cool
- G
- K
- G
- K
- G19:19Why do you get syntax highlighting?
- K
- G
- K
- G
- K
- G
- K
- G
- K
- K
- N20:10🏳️🌈
- K
- N
- K
- N
- K
- N
- K20:17mp420211103_194336_001.mp4Video, 6.7 MB. Not stored in the archive.
- K
- K
- G
- K
- G
- K
pub fn flag(&mut self, colors: Vec<RGB>) { let h: usize = self.height() / colors.len(); for x in 0..self.width() { for y in 0..self.height() { let mut color = match self.info.pixel_format { PixelFormat::RGB => [0, 0, 0, 0], PixelFormat::BGR => [0, 0, 0, 0], PixelFormat::U8 => [0, 0, 0, 0], _ => [0, 0, 0, 0], }; for i in 0..colors.len() { if y <= h * (i + 1) { color = match self.info.pixel_format { PixelFormat::RGB => [colors[i].r, colors[i].g, colors[i].b, 0], PixelFormat::BGR => [colors[i].b, colors[i].g, colors[i].r, 0], PixelFormat::U8 => [colors[i].r, colors[i].g, colors[i].b, 0], _ => [colors[i].r, colors[i].g, colors[i].b, 0], }; break; } } let pixel_offset = y * self.info.stride + x; let bytes_per_pixel = self.info.bytes_per_pixel; let byte_offset = pixel_offset * bytes_per_pixel; self.framebuffer[byte_offset..(byte_offset + bytes_per_pixel)] .copy_from_slice(&color[..bytes_per_pixel]); let _ = unsafe { ptr::read_volatile(&self.framebuffer[byte_offset]) }; } } } - G
This looks right to me.#pragma once #ifndef __riscv #error __riscv was not defined, are you compiling for RISC-V? #endif #ifdef __cplusplus #include <cstdint> #include <cstddef> #else #include <stdint.h> #include <stddef.h> #endif typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef volatile s8 vs8; typedef volatile s16 vs16; typedef volatile s32 vs32; typedef volatile s64 vs64; typedef volatile u8 vu8; typedef volatile u16 vu16; typedef volatile u32 vu32; typedef volatile u64 vu64; #ifdef __riscv_xlen >= 128 typedef __int128 s128; typedef unsigned s128 u128; typedef volatile s128 vs128; typedef volatile u128 vu128; #endif #ifdef __riscv_flen #if __riscv_flen >= 32 typedef float f32; typedef volatile f32 vf32; #endif #if __riscv_flen >= 64 typedef double f64; typedef volatile f64 vf64; #endif #if __riscv_flen >= 128 typedef __float128 f128; typedef volatile f128 vf128; #endif #endif - K
- G
- K
- G
- K
- N
- K
- N
- G
- K22:51Only horizontal bars
- G
- N22:52This is the most important flag
- K
Replying tokalucky0pub fn flag(&mut self, colors: Vec<RGB>) { let h: usize = self.height() / colors.len()…
You can modify this code to support different orientations - G
- K
- G
- K
- G
- K
- G
- K
- K
Replying togudenauI don't remember, does LLVM have an assembler?
No idea, my knowledge is near zero - G
- K
- G23:26That's the bright green in my avatar.
- K
- G
- K
- N23:33This is probably a dumb question
- K23:34there was a way to emulate
- G
- K
- G23:34Never tested it myself.(edited)
- K
- G
- K
- G
- K23:37We don't do that here
- G
- K
- K
Replying togudenauhttps://craftinginterpreters.com/
You know how short my attention span is? I am not able to read more than the slogan on this page - G23:42And I don't think I retained mutch.
- GAnyone know how to either have make change directories or to have configure emit files in a directory that isn't the current working directory?00:45
Neat.$ file build/* build/test.c.o: ELF 64-bit LSB relocatable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), not stripped build/test.cpp.o: ELF 64-bit LSB relocatable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), not stripped build/test.o: ELF 64-bit LSB relocatable, UCB RISC-V, double-float ABI, version 1 (SYSV), not stripped $00:48I can't use compressed opcodes it seems.
- G
.-.ld.lld: error: linker.ld:7: unknown section directive: 4K >>> .text BLOCK(4K) : ALIGN(4K) { >>>01:18
Nice.$ file out/bootloader.elf out/bootloader.elf: ELF 64-bit LSB executable, UCB RISC-V, double-float ABI, version 1 (SYSV), statically linked, not stripped - G
ld.lld: warning: build/entry.o:(text+0x0): has non-ABS relocation R_RISCV_PCREL_HI20 against symbol 'stack_top'01:28Hmm. - G
- G04:43The pointer is in a1.
- K08:11I think I know how to implement FAT32
- K
- K
- K
- K
- K
- G
- K
- K
- N
- K20:05btw20:06what am I looking for? I am after few beers and it's getting hard I'm trying to do something like this:
AssertionErrorKind { InvalidArgument = "invalid argument", InvalidIdentifier = "invalid identifier", InvalidIndex = "invalid index", InvalidToken = "invalid token", UnexpectedToken = "unexpected token", UnknownOperator = "unknown operator", } - K10:05I think
- K
- N15:11I got another invite email but it's still a 404
- K
- N
- K
- K
- N
- N
- K11:29you need to set the correct arguments
- N
- K13:35I always have problems with that
- N
- K
- K
- K
- N
- K
- K
- G
- K09:52Or I'm stupid
- N
- K
- N
- K
- Nhttps://stackoverflow.com/questions/53519668/how-to-attach-to-remote-gdb-with-vscode this should help
Stack Overflow
How to attach to remote gdb with vscode?I want to do remote C/C++ gdb debug with vscode. I use "Native Debug" extension where I do configuration. Here is my launch.json configuration { "type": "gdb", "request": "launch",... - K17:25I have no idea how to setup GDB
- K
- N18:07i believe there is a qemu flag to start a gdb server
- K
- N18:18yes it is
- K
- K20:14Linux drive installed
- N20:16Which distro do you use
- K
- K
- N22:00That's fast
- K22:04I mean GDB
- K
- K
- N
- K11:44I need to change the window color
- K12:27@nailuj what do you think?
- N13:14Rust confuses me
- G
- N@kalucky0 so im trying to follow the blog_os tutorial, and im running into a bunch of errors with the inline assembly in the bootloader when i run
cargo bootimage00:11can you help - K06:53But not at 1 AM
- N
- K
- N
- K
- N
- K12:03Will you have some time in 4-6 hours?
- N
- K
- N
- K
- N
- K
- K
- N
- K
- N
- K12:07You need nightly
- N
- K
- N
- K
- N12:08at this point i expect autoupdate from linux stuff
- K12:10I fucked up interrupts and keyboard input doesn't work
- N
- K
- N
- K
- N
- K
- G
Replying tonailujthe errors something like this... over and over
You need to specify the size of the moves.16:07And such. - K
- J18:48Started contributing maybe March? Maybe earlier
- K
- J
- K
- J19:02This message
- K
- N
- N
Replying tokalucky0@nailuj almost 7 hours? what are you implementing there?
Walked away from the computer for school20:14Timer kept running - G
- N
- G
- N
- N03:10see if you can find what im referring to
- G03:40I need to figure out why qemu won't run my code.
- N
- G03:45There's an extended ASCII smile.
- N03:45i have no code to make that
- G
- N
- K
- N
- K
- G04:23If something doesn't look right, it is your fault.
- K
- K
- K
- N
Replying togudenauIf something doesn't look right, it is your fault.
Not if I didn't write the bootloader and its happening before my kernel is loaded - G
- K
- K@nailuj that might be useful https://github.com/orgs/rust-osdev
GitHub
Rust OSDevOperating System Development in Rust. Rust OSDev has 23 repositories available. Follow their code on GitHub. - N
- K
- K
- K
- G
- K
- G21:34I would do a triple buffer myself. :-P(edited)
- N
- K
- G
- N21:32
GitHub
GitHub - nailuj29gaming/esos: an os that runs esolangs; nothing elsean os that runs esolangs; nothing else. Contribute to nailuj29gaming/esos development by creating an account on GitHub. - N
- K
- N23:46When you have time
- N21:46
GitHub
GitHub - nailuj29gaming/zigvale-barebones: A barebones kernel for z...A barebones kernel for zigvale. Contribute to nailuj29gaming/zigvale-barebones development by creating an account on GitHub. - N
- N
- G23:23See if you guys can figure out why it won't work.
- N
- K
- N
- G
- G21:33For now I made the repo private so.
- J
- G
- J22:20Not that I'd even know how to run an OS on my laptop (without installing it, of course)
- G
- N
- GYou just need qemu + extras installed. You run a script to setup the toolchain and run "make run".22:21In theory it should be able to build everything fine.
- N22:25My os is written in zig, so I use zig build system
- G
- N22:25Meant to be better c
- G
- N22:37It's really good
- G
- N
- G22:49
.section .bss # Create a 16KiB stack .align 16 stack_bottom: .skip 16 * 1024 stack_top: .section text .global _start .type _start, @function _start: # Only run on a single HART #csrr t0, mhartid #bnez t0, spin # Clear satp, just in case csrw satp, zero # Setup the stack la sp, stack_top # Invoke int kernelMain(int hart, void* deviceTree) csrr a0, mhartid # a1 already has the device tree pointer call kernelMain # Spin, main returned... spin: wfi j spin
This is all of the code I have right now.#include "sys/types.h" extern "C" int kernelMain(int hart, void* deviceTree){ (void)deviceTree; if(hart){ return 0; } vu8* serialPort = (vu8*)0x10000000; // No interrupts serialPort[1] = 0; // Enable DLAB serialPort[3] = 0x80; // Set divisor to 0x0030 for 28400 buad serialPort[0] = 0x30; serialPort[1] = 0x00; // 8 bit word, 1 stop bit, no parity serialPort[3] = 0x03; // Enable and clear FIFO serialPort[2] = 0xC7; // IRQs enabled, RTS/DTS set serialPort[4] = 0x0B; serialPort[0] = 'A'; return 0; }22:49But when I single step with GDB and qemu PC never changes.22:49I don't get it. - G
- G
- G
- Ghttps://stackoverflow.com/questions/70029004/risc-v-64gc-ld-truncated-relocation-r-riscv-pcrel-hi20 I'm getting banned again.
Stack Overflow
RISC-V 64gc LD Truncated Relocation: R_RISCV_PCREL_HI20I can not get ld to link a very simple program because of a truncated relocation. (init+0x0): relocation truncated to fit: R_RISCV_PCREL_HI20 against symbol `globalPointer' defined in .bss section ... - G
- N
- K14:59Page fault lmao
- G
- K
- N
- K
- G19:55¯\_(ツ)_/¯
- G
Life.$ make clean ; make run Cleaning... removed 'out/bootloader.elf' removed 'build/entry.o' removed 'build/main.cpp.o' Assembling source/entry.s Compiling source/main.cpp Linking bootloader.elf Running out/bootloader.elf Hello world!22:54Now to figure out debugging. - K
- K
- K
- K
- J
- G
- K
- K
- G
- G
IT LIVES/usr/bin/qemu-system-riscv64 -machine virt -cpu rv64 -smp 1 -m 256M -drive if=none,format=raw,file=harddrive.img,id=foo -device virtio-blk-device,scsi=off,drive=foo -serial mon:stdio -bios none -device virtio-rng-device -device virtio-gpu-device -device virtio-net-device -device virtio-tablet-device -device virtio-keyboard-device -bios none -kernel out/bootloader.elf Hello world! Process finished with exit code 0 - G02:10Progress is being made.
- N
- N
- G03:01Currently have broken logging because of a lack of global constructors.
- N
- G
- N
- G
- G
- G
- K
- G
- K
- G
- N
- G18:27I guess you could call my OS esoteric.
- N
; ModuleID = 'length' source_filename = "length" define i32 @main() { entry: %stackptr = call i64 @initStack() call void @push(i64 %stackptr, i64 42) call void @lengthOutn(i64 %stackptr) ret i32 0 } declare i64 @initStack() declare void @freeStack(i64) declare void @push(i64, i64) declare i64 @pop(i64) declare void @lengthInp(i64) declare void @lengthAdd(i64) declare void @lengthSub(i64) declare void @lengthDup(i64) declare void @lengthOutn(i64) declare void @lengthOuta(i64) declare void @lengthRol(i64) declare void @lengthSwap(i64) declare void @lengthMul(i64) declare void @lengthDiv(i64) declare void @lengthRor(i64)18:46I generated this so far18:46It does what is expected, prints 4218:46Hardcoded for now - K21:32It's one big fucking scam
- J
- K21:37I would have to pay about $250 to be able to sell those
- J
- K
- K21:56lmao
- J21:57Is this site like an auction sort of thing or a click-and-buy
- K
- J21:59How so?
- K22:00You can select
- J22:00I think you'd make more if you put it on auction mode
- K
- J22:01I'm not sure what you mean
- K
- J
- K
- J
- K
- J
- K22:04but it also can't be lower than 0.1 ETH
- J
- K
- Nhttps://github.com/Lengthlang/lengthlvm behold, the dumbest thing I've ever made
GitHub
GitHub - LengthLang/lengthlvmContribute to LengthLang/lengthlvm development by creating an account on GitHub. - K
- N
- K
- N
- K
- N
- J
- N00:09I have multiple screenshots of nft
- K
- K
Replying tonailujI have multiple screenshots of nft
You can absolutely screenshot my NFTs I can even DM you the originals - N
- J
- K
- J
- K
- T
- K00:12thanks @TeXit
- N00:13I'm poor so I can't make them
- K
- J00:15Are you $1000 in right now?
- K
- J00:16So you're $250 in
- K
- J
- KIf you use Ethereum network then you pay about $250 gas fee to be able to post NFTs If you use the other network you pay $0 to post but you can't do auctions and you don't get a percent from reselling the NFTs you made After you sell an NFT you pay 2.5% commission regardless which network you use
- J
- KTbf, It might be a little bit not ethical or smth But I love making money on people stupidity00:21I'm going to post more tomorrow because it's easy as fuck to make them It took me like 10 minutes to make those 4 I posted
- N00:43Also how much is one token on the poor chain
- K
Replying tonailujCan you explain how you do it
I use several NN and other algorithms to create them and then just... https://opensea.io/asset/create - K
- N
- J
- K
- A
- K
- A01:03Are you selling nfts now
- K
- A
- J
- A
- K
- A
- J
- K
Replying toAzzyypaarasI will help you make them be more palatable if you give me a cut :sus:
You have a deal - A
Replying toJack PapelInb4 kalucky starts a massive pump & dump scheme
Ligma grindset tip #3253257: commit white collar crimes - J
- A
- J
- A
- J
- K
- J
- K
- A
Replying tokalucky0Tbf, It might be a little bit not ethical or smth But I love making money on people…
Oh, it is not ethical at all, but ethics are a lesser man's cope - K
- N01:07I should try it
- J
- N01:071 of a kind
- A
Replying toJack PapelImo if you rag on nfts, you should be ragging on crypto equally as much. They're usually…
I only rag on nft owners because they are fucking idiots - K
- N
- J01:08mostly the latter of the three
- K
- J
- N
- J
- G
- A
Replying togudenauHow the heck did this channel get to something as useless and wasteful as NFTs?
Good question, I got randomly pinged - N01:11I built an llvm frontend for it
- K
Replying togudenauHow the heck did this channel get to something as useless and wasteful as NFTs?
Scams might be wasteful But they may also be very lucrative - A
- K
Replying toAzzyypaarasNFT sellers... :balls:
some of them are even more stupid tbh flooding the market with autogenerated shit is just stupid01:131000 almost identical NFTs in one hour(edited) - N
- G
- A
- KNft => #blockchain
- G
- N
- A
Replying togudenauAlso these NFTs are going to vanish in a bit when servers die. NFTs are centralized.
Exactly01:14This is a bubble - J
- N
- A
- N01:17Just general tech talk
- G
- G
- G
- K
- G
- G
- A
- G
- G
- G06:25
Stack Overflow
Including .init_array section to Linker script produces unusable ou...I try to port a c++ project to RISC-V. The project was already successfully compiled for ARM using IAR Toolchain and for Windows. For the RISC-V port I have written my own CRT0.S file which does a... - K
- K
- J
- K
- K
- J
- K00:09And my previous OS already had some ifs and algebraic expressions































































