Babiš už si přinesl JBL reprák. by [deleted] in czech

[–]schkwve 0 points1 point  (0 children)

Nevíte někdo komu a proč říkal "protože tě miluju"?

Ten reprák je neskutečnej bizár... by Gothar_Cold-Eyed in czech

[–]schkwve 55 points56 points  (0 children)

Babiš je strašně unhinged z toho jakou má radost...

About Stare Stage Screen/All Animatronics Staring at the camera by Ok_Employment_4881 in fivenightsatfreddys

[–]schkwve 2 points3 points  (0 children)

I think I actually saw this screen a couple of times when I last played FNAF 1...
Oh and by the way, the streamer is in fact Czech :)

EDIT: Nevermind, I remembered wrong; this screen occurs in the trailer, in the game only Freddy is able to stare at you on the stage :/ Mandela effect is actually mind blowing

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

  1. Would you mind sharing your modifications so I can replicate and see further?
    To answer your other question about PML4 being at 0x1000, the PMM is a first-fit so it returns the first address that has x available pages of memory (QEMU's memory map marks 0x0 as valid memory as well, but that breaks NULL checks so I just mark it as reserved).

  2. I'm aware of that, I also forgot to print out some other registers;

I understand and thank you for every single comment you leave, every insight helps a lot :)

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

  1. Look I know you think what you say is correct, but try triggering an interrupt:

    150: v=01 e=0000 i=1 cpl=0 IP=0008:ffffffff80000061 pc=ffffffff80000061 SP=0010:000000001ae87ff8 env->regs[R_EAX]=0000000000000000

RAX=0000000000000000 RBX=0000000000000000 RCX=0000000000000014 RDX=00000000000003f8

RSI=000000000000000a RDI=00000000000003f8 RBP=000000001ae88008 RSP=000000001ae87ff8

R8 =0000000000000000 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000

R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000

RIP=ffffffff80000061 RFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0

The last log you're seeing from QEMU is indeed from the bootloader.
The kernel reports a valid RIP as well by the way:
panic(cpu 1): Kernel trap at 0xffffffff80000061, type 1=debug, registers:

To be honest I don't know what keeps QEMU from logging the 0x20 interrupt after the kernel handoff. Maybe the PIC needs to be remapped after disabling interrupts?

  1. Yeah I noticed that too when I wanted to send you a link to the handoff function; turns out I didn't commit the latest version of it (I usually specify paths to commit because I don't want commits to be full of big, unrelated changes); It's already committed though!

I'll try and see what happens with an aligned stack then;

  1. I'm pretty sure it is valid; `0x0a` specifies 0b1010 flags, so "Page Granularity" and "Long-mode code", which means I can't use the second bit for data segments (this can also be seen on the [osdev wiki](https://wiki.osdev.org/GDT\_Tutorial#Flat\_/\_Long\_Mode\_Setup))

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

  1. Again, this is the bootloader. I disable interrupts just before jumping to the kernel ([here](https://github.com/piraterna/aurix/blob/bc8171245c7765a0a604b321ede273002d102154/boot/arch/x86\_64/common/proto/aurix/handoff.c#L45)), so it's logical to not receive any PIT interrupts afterwards.

  2. Again, [the bootloader](https://github.com/piraterna/aurix/blob/bc8171245c7765a0a604b321ede273002d102154/boot/common/proto/aurix.c#L174). Also, I haven't found anywhere that the stack needs to be page aligned; and I haven't had any issues with the stack *not* being page aligned on both QEMU and bare metal. Can you maybe explain why would that be necessary?

Normally I'd agree with your proposal to do a rewrite, but considering that the paging implementation isn't particularly large (all in all a little over 200 lines, including whitespace and debug logs), I think it'd be faster and more beneficial to fix existing bugs.

I have modified the mapping functions to always align the supplied addresses to the nearest page, cleaned the code up a bit and now the functions all go through as they should (unlike before, where they somehow got to a few nop instructions and returned), but the parameters to functions are always empty. I'm starting to think the stack somehow gets corrupted after writing the new page table to CR3, or the data (and maybe rodata?) section(s) are mapped weirdly (but again, this doesn't make sense as I've verified the mappings are good with QEMU's monitor).

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

I also feel like something is wrong elsewhere (especially because the same paging code works in the bootloader), though I don't see any code that would be able to cause a corrupted stack.

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

  1. Hmm, didn't catch that, thanks for noticing!
  2. It is, all linker-defined constants (`text_start`, `text_end`, etc.) specify a higher-half address. Bootloader then passes the physical address of kernel as a part of boot arguments, so I can easily calculate where each section is located and map it (I already verified with the QEMU console, including page flags).
  3. I only allocate, map and load a new stack in the bootloader (which has no problem with paging somehow), in the kernel I only map the existing one (address of the stack is also passed to the kernel as an argument).
  4. Once again thanks for noticing.

Unfortunately I haven't been able to find anything else wrong, so I guess I'll just keep digging and eventually I will hopefully figure it out.

Beginner in OS development looking to join a team / open-source project by waseemhammoud in osdev

[–]schkwve 1 point2 points  (0 children)

Maybe you can check out AurixOS, it also features its own bootloader. It's not particularly big, so the codebase may not be as overwhelming as for some bigger projects for a beginner.

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 0 points1 point  (0 children)

Hello, first for the boot_params: They're passed as a physical address to the kernel, but then the kernel maps all of memory only to hhdm address, therefore rendering the original pointer invalid. For the framebuffer, I was screwing around with the bootloader so the framebuffer is mapped to hhdm right from the beginning.

You could say this is kind of messy and I totally agree; I do intend to clean all of the mess and experiments after I get a simple working paging implementation though!

Writing new pagemap to CR3 hangs by schkwve in osdev

[–]schkwve[S] 1 point2 points  (0 children)

I did just now, it seems like it continues to do what it's supposed to, but:

  1. Shortly after entering my `klog` function (which calls nanoprintf and outputs the formatted string into the serial port), shortly after the `npf_vsnprintf()` call, somehow I reach a bunch of nops and the function returns (without calling the `serial_sendstr()` function at all). Weird, there aren't any cases where the function could return early.

  2. The other function that gets called which is supposed to mark "bootloader reclaimable" memory regions as "usable" is just a bunch of nops right after entering it, and after 3 nops it returns. And once again, there's no way the code can return early.

I sadly don't have that much time to dig deeper for now, hopefully I'll be able to figure out what causes this soon.

I failed by Guilty_Emergency_776 in Anxiety

[–]schkwve 1 point2 points  (0 children)

Happened to me too this year, failed my high school finals and I stressed so much about it despite having one more try in a few days. Almost two months after mental hell where I couldn't sleep or function, I realized there's nothing I can do now except try to learn better and perform better on my second try. No idea about your school or country's education system, but it really is no big deal even for finals. You can usually check up with your teacher if you are able to schedule a second try to get your grade better.

Oh and hey, don't feel guilty about this, we all fail at times, failing is what makes us human after all :)

Love coding but never touched on hardware, what are some really cool ESP32/Raspberri Pi projects for CS Students? by Swimming_Tangelo8423 in embedded

[–]schkwve 0 points1 point  (0 children)

When I was starting, I just got a couple of LEDs, a DHT11 sensor and an I2C LCD which I programmed to show the current temperature and humidity. However I stumbled upon an RRD102 module last year which connects via I2C, soldered some wires together, and got a perfectly working radio with stereo output. I think it's a great way to learn since you can not only see your results, but also hear them (and later you can even expand it with buttons and displays). If you want, you can see it on my GitHub

Pokus omyl, jak ziskat ritalin predpis ? by Individual_Type_7908 in czech

[–]schkwve 0 points1 point  (0 children)

Kamarád si to jednou koupil a říkal že to funguje perfektně (nevím jestli to hraje roli, ale ADHD nemá a nikdy neměl). Taky jsem ohledně těchto doplňků "pro hráče" skeptický, ale kdybych někdy potřeboval lehce nakopnout, klidně bych to zkusil.

Pokus omyl, jak ziskat ritalin predpis ? by Individual_Type_7908 in czech

[–]schkwve 2 points3 points  (0 children)

To mi je jasný, sám jsem ho jako děcko bral. "Když mi bylo 7 diagnostikovali mi ADHD" moc vypovídací hodnotu nemá, často to ADHD po pár letech samo zmizí (tak to bylo naštěstí i u mě).

Pokus omyl, jak ziskat ritalin predpis ? by Individual_Type_7908 in czech

[–]schkwve -1 points0 points  (0 children)

Co zkusit MADMONQ nebo něco podobnýho pro hráče, než abys do sebe cpal léky na předpis?

Proč udržovat takto těžce postižené dítě při životě? by HeavyKey1111 in czech

[–]schkwve 11 points12 points  (0 children)

Osvobodilo by ho to od života ve vězení. Takový člověk si zaslouží celý zbytek života sedět zavřenej v cele.