A potentially interesting blog

Posted by Astryl on Oct. 4, 2012, 3:48 a.m.

Of course, the potential interest in this blog will depend on whether the people reading it have any interest in the subject matter or not.

I haven't written an interesting blog in a while though; my life has suddenly been frantic, what with work. Not stressful, just an unaccustomed lack of time to do things.

My S4D entry

I've got the game working, which is always the easiest part. Making the content is the part that throws me off. I fully intend to release it though; complete or not.

Game mechanics so far include being able to pick some blocks up and throw them, an automap system, view shifts, and basic platforming.

Even with a month left, I see this going nowhere.

OS Development

I'm still working on my kernel and surrounding system, slowly. So far, I've completed all IRQ handlers, tweaked the fault page generator, and started the groundwork for the memory management system.

Writing a memory management unit is fun, in every sense of the word. At first, you may be thinking that it's incredibly difficult to do, but in the end, you come to the realization: There's no wrong, because there's nobody to tell you you're wrong. Ergo, no Windows/Linux/Whatever freaking out because you touched their protected pages.

The paging protection mechanism is handled by the processor, though. A page is allocated and referenced through a page table.

The page table is, in C terms, an array of 32-bit values. The first 12 high-order bits are used for various status flags (Such as whether the page is 'present', has been accessed, etc), and the 20 remaining bits are used for the frame address.

Allocating memory merely means setting a few of the status bits (Notably, the Present bit, and sometimes the Read Only bit). The program requesting the allocation will then get a virtual address returned to it. The kernel handles mapping virtual space addresses to physical addresses.

There is nothing mysterious about memory management; it's just a case of micro-logistics with 4KB pages.

The kernel doesn't have to worry about stepping on anything. It does, however, have to prevent any processes it spawns from stepping on each other, and of course itself.

Speaking of processes, my basic task model… I'm going to try use a simple timer based task roster. Every new process gets added to a list. These processes are sorted on insert, and carry various 'task weights' (Or priorities). In a theoretical frame of execution, a pointer is pointing to the first entry in the table. It jumps to that code. The code in question will execute until it hands over to the OS, requests an asynchronous IO read/write, or the interrupt timer triggers.

When one of these things happens, the 'state' of the process is saved (A flash save of any registers involved, basically), and the OS moves onto the next task in the list and repeats.

Of course, I can't create my task model without first having a kernel heap, and I can't have that without the memory manager. Once I'm done with these three main problems, I can start working on the other 'problems'. Notably, a VFS (Virtual file system), User modes, Executables, and the OS API.

Of music and songs

I have never written a song. Probably never will, because I can't imagine myself singing again. Ever.

But regardless, I still write pieces of music. Most commonly for games, but also for the Guitar and Keyboard. I was practicing on my guitar again this morning, turning out some improvised Jazz, when my 1st string snapped and slapped me across the thumb. Fortunately it didn't hurt me this time (Last time the point of the string hit my hand. Stung for quite a while).

I'm still thinking of buying a cheap keyboard next month. Preferably one that can be used as a MIDI controller, and supports basic key velocity. A lot of emphasis can be added to your music if you can control the tone of each note…

I'm still writing a ton of chiptune, I just haven't released any in a while. I'm sitting with around 20 new tracks at the moment, most of them complete. I might drop some of them on SoundCloud sooner or later.

I also intend to write that beginners guide sooner or later (For Famitracker, later on for VGM Maker, notably instrument creation).

I've been drawing a lot of inspiration from the old Commodore 64 composers, notably Ron Hubbard. I have something here that may be of interest to some:

http://www.hvsc.c64.org/

Over 40000 SIDS. If you're a chiptune artist, you can draw a lot of inspiration from these, and at the same time feel like crawling up into a ball and giving up…

Upgrades

I was rejected for that contract, the one that would have netted me a laptop and a cellphone. Probably my credit history, which is practically non-existent.

So I went shopping around through catalogs again, this time browsing through some of the local PC part suppliers, and set my sights on a few upgrades to my PC that I can afford.

Specifically, an Intel Pentium G620, a Gigabyte Socket 1155 compatible motherboard, and 2GB of DDR3 memory. All of this is better than what I currently have. It also offers me the opportunity to incrementally upgrade (The motherboard is compatible with the current i* range, for instance).

I'm being nice and using the old parts to build my brother a PC. The one he has earned a nickname from the family: Dracula. It's an ancient Celeron 1.2GhZ, with 512mb of RAM, and a tendency to not work when it doesn't feel like it, only to 'resurrect' every 100 days.

Actually, it's problem is simple: The RAM is derped. But nobody is going to fork out money to buy more unreliable DDR ram, which costs more than DDR2/3.

The only thing I'm not upgrading is my version of Windows. Because I refuse to pay R980 for 7 Home Basic. There is a special deal on Win 8 at the moment, but I absolutely abhor it. I like my nice buggy open-ended systems that I can choose to screw up, thank you very much Microsoft.

Programming Goals

I don't know if I've ever talked about this before, but hey, here I am writing a kernel and OS from scratch. Why? I was thinking about that the other day.

The reason is simple. I want to try learn as much about programming as possible, in all the possible facets; this includes Systems design, low-level programming, driver programming, compiler design, sound system drivers, multimedia programming, etc, etc. I guess I just want to pull of the near impossible and learn everything. Probably because I love programming.

Anyway, my list of lifetime projects is kinda looking like this:

> OS + Kernel + Custom Bootloader (Got one, but use GRUB too)

> 3D game with custom software renderer

> Raytracer (Already done, in part)

> 3D game in OpenGL (Done. See Exile)

> Music synthesizer/tracker.

> Video format and player

> Image format and viewer (Done, but lost. REWRITE ALL THE CODE!)

> Packed file format (Done)

> Compression algorithm

> Interpreter for a custom script language

> Byte-code based scripting language

> Compiled programming language

> Assist AI for general applications.

> Several more, most minor.

Most of these will take ages, if I ever get past the preliminary research. These exercises prove no point, and won't net me any money, but they're great for learning purposes. At the moment, I'm focusing on the OS, and the many interesting problems that go with it. My ultimate goal with it is to make it 'self hosted'. That is, I want to compiled GCC for it, or even better, my own variation of the C language. I'm gaining an intimate understanding of X86 assembly now, and therefore can begin to see myself creating a compiler in the near future.

Anyway, I'll end the blog here. Looks like I've gotten back into the writing groove.

TL;DR:

I'm crazy, insane, out of my mind, etc, etc.

Comments

Astryl 11 years, 11 months ago

Quote:
For the record, I'd totally listen to guitar shredding chiptune music. Your music already sounds like punk music to me, which is my favorite kind of music. Obviously it's more… chippy.
Well then I'll definitely remaster some of my tracks then.

I've still got a PC AT sitting in my garage. Fully functional, with the exception of the CGA video card.

Charlie Carlo 11 years, 11 months ago

I have a Commodore 64 in my den. Still works. I played some ye-olde games on it before.

TDOT 11 years, 11 months ago

Interesting idea for the process scheduler. Though with the algorithm you're describing, won't new high priority processes be inserted at the top of the list, and therefore be ignored until the rest of the processes in the list have had their time slices?

Astryl 11 years, 11 months ago

Quote:
Interesting idea for the process scheduler. Though with the algorithm you're describing, won't new high priority processes be inserted at the top of the list, and therefore be ignored until the rest of the processes in the list have had their time slices?

Interesting problem. I'm not sure, but at the speed that individual processes will be switching, I'm not too sure it'll be an issue. Only one way to find out though. Make it, then tweak it later if needs be.