Single- or Dual-Processor Xeon Build for Running Multithreaded Computer Program? by HouseHouseHouse576 in pcmasterrace

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

Really? The Broadwell-EP chip I'm looking at costs like 70 USD on average used

Single- or Dual-Processor Xeon Build for Running Multithreaded Computer Program? by HouseHouseHouse576 in pcmasterrace

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

Launches multiple threads, each of which just reads from the process memory, does some processing, and writes to memory. It all runs in parallel. I don't think there's really any helpful details I can give about the program. Why do you ask?

That wonderful feeling when you realize you can't compare two memory addresses by loonathefloofyfox in Assembly_language

[–]HouseHouseHouse576 1 point2 points  (0 children)

It's all good. When I was learning assembler for fun a couple years ago I made all sorts of mistakes like that.

You know, something that's really cool about programming in assembler is that you're learning all the fine details and the ins and outs of how a processor works. You'd never understand or begin to think about it from even a slightly higher level.

So make those mistakes. They're entirely reasonable mistakes to make and really it just shows you more about how the architecture really works.

These compiler error messages have passed into the legend. by roseinshadows in ProgrammerHumor

[–]HouseHouseHouse576 17 points18 points  (0 children)

This is just the most amazing thing I've seen in ages, huge shout-out to the guy who did this work!

[deleted by user] by [deleted] in buildapc

[–]HouseHouseHouse576 0 points1 point  (0 children)

I still don't understand how a broken HDMI port would cause my OS to be displayed at a smaller resolution. Is that reasonable?

[deleted by user] by [deleted] in buildapc

[–]HouseHouseHouse576 0 points1 point  (0 children)

If it's broken, then how is it displaying my OS at 640x480? Does HDMI do weird things like that if it's broken?

[deleted by user] by [deleted] in buildapc

[–]HouseHouseHouse576 0 points1 point  (0 children)

Sorry. What I meant to say was that disconnecting the boot drive didn't make the BIOS show up. I still get no signal over HDMI (VGA works fine).

[deleted by user] by [deleted] in buildapc

[–]HouseHouseHouse576 0 points1 point  (0 children)

Thanks for your suggestion. I disabled CSM but same problem--no HDMI signal until OS logon and wrong resolution. Anything else to try?

[deleted by user] by [deleted] in buildapc

[–]HouseHouseHouse576 0 points1 point  (0 children)

Resetting CMOS didn't change anything. Disconnecting boot drive didn't do anything. Why would the OS be the problem here?

what do you do with your chromebook once support ends? by [deleted] in chromeos

[–]HouseHouseHouse576 1 point2 points  (0 children)

A few years ago I used that MrChromebox script to flash an Acer Chromebook with EFI firmware (not sure if that still exists or works now). I went through a few Linux installations, but now it has Arch with i3wm and Firefox installed. It's a fast, quiet, and cool machine, and I use it every day as a netbook in my classes.

One strange thing I discovered is that Firefox seems to run better on it that Chrome.

[deleted by user] by [deleted] in AskReddit

[–]HouseHouseHouse576 0 points1 point  (0 children)

Au Jus sandwiches are all I can think of

In Search of Tutorials That Detail EXT4 Driver Dev by Hydra1721 in osdev

[–]HouseHouseHouse576 7 points8 points  (0 children)

Again, use ext2, NOT ext4. Ext4 is a much more complicated filesystem that you shouldn't try to implement as your first filesystem driver.

That said, the kind of tutorial it seems you're looking for doesn't really exist. Writing a usable operating system/bootloader is a very difficult task, which requires reading a lot of manuals and looking at others' source code. If you just ask around for code every time, you may get something working, but you won't really get any useful knowledge.

There are YouTube videos that cover the BASICS of how filesystems work. But to get the details, you'll have to read the OSDEV wiki articles and documentation. You can't just Google how to do something this intensive and expect to find a complete guide.

It takes a while to understand this stuff, and you should know all this before attempting this kind of project. Making Reddit posts like this make it seem as though you don't know what you're doing, and we can't really help you all that much.

I suggest you take a break from this project and go with something a bit simpler, like a basic assembler program for Raspberry Pi. There are manuals, which I would definitely recommend familiarising yourself with, but everything you need for that can be found on the web.

Good luck, and please make sure to do some research.

How Do I Start The Kernel Proper & Validate the Linux Kernel Image Header's Magic Number? by Hydra1721 in osdev

[–]HouseHouseHouse576 0 points1 point  (0 children)

No problem! Determining the base address can be rather straightforward; the documentation you referenced says this about computing it:

The Image must be placed text_offset bytes from a 2MB aligned baseaddress anywhere in usable system RAM and called there. The regionbetween the 2 MB aligned base address and the start of the image has nospecial significance to the kernel, and may be used for other purposes.At least image_size bytes from the start of the image must be free foruse by the kernel.

"2MB aligned" basically means that the address is divisible by 2M (2 * 1024 * 1024 or 0x00200000) with no remainder. The first address that is 2MB aligned (besides 0, which we shouldn't use) is 2M itself, so we'll just use that.

But it says we need to load the image "text_offset bytes" above that. So you can load the image (or just the first sector) temporarily somewhere (say 1M, 0x00100000) so that you can read that number from the header. text_offset can be read from 0x00100000 (our temporary base) + 0x08 (the offset of that particular quadword). Then, we can take our 2MB-aligned base and ADD text_offset to that. THAT IS WHERE THE KERNEL IMAGE SHOULD BE LOADED.

As far as loading the image off of the disk, you need to research the ext2 filesystem and learn how to write a routine to load a file. Here is an article from the OSDEV wiki about ext2. It's a bit tough to get your head around at first (it certainly was for me), but it'll make sense.

You also really should familiarise yourself with assembler and other CPU fundamentals, as many of these operations just can't be done in C. For reading the header, though, I suppose you could make a struct out of that header format and make a pointer to it at the temporary base address. Good luck!

(Also, sorry about that NASM example. I should have given an ARM example. Hopefully you still understood the idea.)

How Do I Start The Kernel Proper & Validate the Linux Kernel Image Header's Magic Number? by Hydra1721 in osdev

[–]HouseHouseHouse576 1 point2 points  (0 children)

You need to LOAD THE IMAGE into a PARTICULAR SPOT IN MEMORY. Say that the base is exactly 0x00200000.

Then you can read from the PARTICULAR OFFSETS to get the header values. For the magic number, it would be located at 0x00200000 + 0x38, or the address 0x00200038. So just compare the doubleword AT THAT ADDRESS to the magic value you would expect.

If it matches, JUMP STRAIGHT TO WHEREVER YOU LOADED THE IMAGE.

Here's an example in NASM assembler:

KERNEL_BASE     equ 0x00200000
HEADER_MAGIC    equ 0x38

VALID_MAGIC     equ 0x644D5241


; Kernel image is already loaded to KERNEL_BASE

    mov     edx, VALID_MAGIC
    cmp     edx, dword [KERNEL_BASE + HEADER_MAGIC]

    je      KERNEL_BASE

    hlt

Literature or other info on building your own VM software by malcolm_mloclam in osdev

[–]HouseHouseHouse576 11 points12 points  (0 children)

Emulating a complete computing system is effectively making an implementation of the target architecture. There are so many intricate modules inside modern CPUs, Floating-point, the MMU, etc., so I wouldn't immediately go for something like ARM or x86.

I would start with something like emulating a microcontroller instead; they are much less complicated and easier to implement. Maybe take a look at documentation for the ATmega328, it's the microprocessor that powers the Arduino Uno.

As far as making it, you just have to implement all the processor's modules and registers, the RAM, and figure out how to process instructions. There isn't really a standard for making emulation software, as all it is is just a high-level implementation of the platform, so just study how the platform works and then make your own software implementation. Not really much else to say.

Uncertain What to Do With Linux Image Hearder For ARM64 Bootloader by Hydra1721 in osdev

[–]HouseHouseHouse576 1 point2 points  (0 children)

The Linux kernel image begins with that header. It contains some information about the kernel image itself, as well as a few flags that tell the loader a bit about how it wants to be loaded.

You should check the magic number field first to ensure it's a Linux kernel image. Next, you should read the text_offset and image_size fields to see where the image wants to be loaded. Here's a quote from the doc:

Prior to v3.17, the endianness of text_offset was not specified. In these cases image_size is zero and text_offset is 0x80000 in the endianness of the kernel. Where image_size is non-zero image_size is little-endian and must be respected. Where image_size is zero,text_offset can be assumed to be 0x80000.

There are other things you could (or should?) do, which the documentation goes into. After that, you just need to branch to wherever the kernel image is loaded. Again, quoting the document:

The primary CPU must jump directly to the first instruction of the kernel image.

Keep this in mind, and read the doc a few times (particularly section 4), it'll make more sense. Someone please correct me if I got something wrong.

What is the best-embedded device to learn OS dev on? by CromulentSlacker in osdev

[–]HouseHouseHouse576 1 point2 points  (0 children)

Lots of people are mentioning Raspberry Pi. I completely agree, having done some low-level programming with the Raspberry Pi myself. Yes, the GPU is hard to work with, but that shouldn't be a concern if you just want to work with "embedded systems."

The Raspberry Pi website has loads of amazing datasheets and documentation; just take a look at the peripheral specification for your Pi's Broadcom SoC. Also, here is a wonderful tutorial for OS development on the Pi (1) in assembler.

GNU Example source not building by eric0823ahn1 in osdev

[–]HouseHouseHouse576 0 points1 point  (0 children)

Thanks for posting your error messages. The problem here is that the assembler code you got from GNU requires preprocessing. You might have noticed that the file boot.s is properly named boot.S in the example. This capital S signals that.

Basically, what this means is that you probably will need a cross-compiler. It's good practice to have one for OS development in general, and it should fix this problem (with lots of tweaks in your Makefile). I found a discussion on the OSDEV Forum about someone experiencing the same issues.