<?xml version="1.0"?>
<rss version="2.0"><channel><title>Architectures Latest Topics</title><link>https://oc.cil.li/forum/48-architectures/</link><description>Architectures Latest Topics</description><language>en</language><item><title>Javascript for Open Computers</title><link>https://oc.cil.li/topic/455-javascript-for-open-computers/</link><description><![CDATA[
<p>
	EDIT 2: I've opened a Patreon at <a href="https://patreon.com/mrmakeit" rel="external nofollow">https://patreon.com/mrmakeit</a> where I'll post updates.  I'll try and cross reference those updates here as well, but I do suggest checking it out as I'll have other stuff there as well.
</p>

<p>
	 
</p>

<p>
	The Open Computers JavaScript arch!
</p>

<p>
	 
</p>

<p>
	No longer are you tied to using a single language for your comps.  Dominate others with the Power of JAVASCRIPT!
</p>

<p>
	 
</p>

<p>
	<a href="https://github.com/mrmakeit/OCJS/releases" rel="external nofollow">Download</a> / <a href="https://github.com/mrmakeit/OCJS/" rel="external nofollow">Source</a> / <a href="https://github.com/mrmakeit/OCJS/wiki" rel="external nofollow">Wiki</a> / <a href="https://mrmakeit.github.io/OCJS-Emulator/" rel="external nofollow">Emulator</a>
</p>

<p>
	Features:
</p>

<ul><li>
		Program in JavaScript
	</li>
	<li>
		Default EEPROM.  Drop an init.js on a floppy and go.
	</li>
	<li>
		That's it!
	</li>
</ul><p>
	ToDo:
</p>

<ul><li>
		Still no memory or cpu management, so definently not server safe.
	</li>
	<li>
		Needs an OS.
	</li>
	<li>
		<s>No built in code.  You'll need to program an eeprom yourself.</s>  This is no longer the case.  New alpha will have an usable eeprom now.
	</li>
</ul>]]></description><guid isPermaLink="false">455</guid><pubDate>Thu, 12 Feb 2015 01:33:44 +0000</pubDate></item><item><title>[MC1.7.10-1.10.2][OC1.6] Thistle, a 6502 based architecture for OpenComputers</title><link>https://oc.cil.li/topic/1244-mc1710-1102oc16-thistle-a-6502-based-architecture-for-opencomputers/</link><description><![CDATA[
<p>
	Just got finished implementing and testing all the various features for my architecture I've called Thistle
</p>

<p>
	Thistle is a 6502 based architecture for OpenComputers
</p>

<ul><li>
		Fully persistable
	</li>
	<li>
		Supports up to 256MB of memory via memory mapping
	</li>
	<li>
		Built in VT100 like terminal and keyboard input
	</li>
	<li>
		Built in DMA Engine
	</li>
	<li>
		Built in EEPROM (soon to have built in assembler (and network booting hopefully))
	</li>
	<li>
		Component and Signal interface via TSF Serialization
	</li>
	<li>
		Supports booting programs off Managed Filesystems and Unmanaged drives
	</li>
	<li>
		API to allow others to create 6502 friendly mappings of components
	</li>
</ul><p>
	Various documentation is available on the <a href="https://github.com/gamax92/Thistle/wiki" rel="external nofollow">GitHub wiki</a>
</p>

<p>
	<strong>Downloads</strong>
</p>

<p>
	Source: <a href="https://github.com/gamax92/Thistle" rel="external nofollow">https://github.com/gamax92/Thistle</a>
</p>

<p>
	Releases: <a href="https://github.com/gamax92/Thistle/releases" rel="external nofollow">https://github.com/gamax92/Thistle/releases</a>
</p>

<p>
	(The 1.9.4 release will also work with 1.10.2)
</p>
]]></description><guid isPermaLink="false">1244</guid><pubDate>Tue, 21 Mar 2017 05:39:28 +0000</pubDate></item><item><title>OC-Wasm: WebAssembly for OpenComputers</title><link>https://oc.cil.li/topic/2261-oc-wasm-webassembly-for-opencomputers/</link><description><![CDATA[<p>
	Hi all! I mentioned this in IRC but realized I should probably post it here as well. I made a new architecture that runs WebAssembly. It’s available <a href="https://curseforge.com/minecraft/mc-mods/oc-wasm" rel="external nofollow">here</a> on CurseForge.
</p>]]></description><guid isPermaLink="false">2261</guid><pubDate>Tue, 24 Aug 2021 05:35:13 +0000</pubDate></item><item><title>[MC1.12.2][OC1.7] OpenPython,&#xA0;micropython available on OpenComputers</title><link>https://oc.cil.li/topic/1744-mc1122oc17-openpython%C2%A0micropython-available-on-opencomputers/</link><description><![CDATA[<p>
	<a href="https://minecraft.curseforge.com/projects/openpython" rel="external nofollow">https://minecraft.curseforge.com/projects/openpython</a>
</p>

<p>
	<a href="https://github.com/EcmaXp/OpenPython" rel="external nofollow">https://github.com/EcmaXp/OpenPython</a>
</p>

<p>
	OpenPython makes micropython available on OpenComputers.
</p>

<p>
	micropython is Python for embedded devices and is different from CPython.<br>
	Currently, micropython is partially compatible with Python version 3.4 as of October 2018.
</p>

<p>
	Features include:<br>
	- Fully persistable.<br>
	- Runs in a sandboxed environment and does not require a separate native DLL.<br>
	- Supports virtual file system.<br>
	- It can call other components and supports Lua architecture's UserData.
</p>

<p>
	Limitations include:<br>
	- The firmware is 256 KB and the memory limit has the same limit as the Lua architecture, but the stack is allocated in a separate memory.<br>
	- Most modules are difficult to use because the battery is partially included.<br>
	- The operating system is not yet fully implemented, so the Python interpreter now runs.<br>
	- Ctrl + C is not supported, so if you accidentally run infinite repeated code, the only way to stop it is to turn the computer off and then on.
</p>

<p>
	To use the Python architecture, you need the following items:<br>
	- EEPROM (OpenPython): I'm sorry, but you have to bring items from the Creative tab.<br>
	- Floppy Disk (OpenPython OS): This item can be obtained by creating a floppy disk and Scrench, or you can check it on the Creative tab.<br>
	- OpenPython CPU: You can choose OpenPython architecture by holding Shift + Right Click on the Lua architecture CPU.
</p>

<p>
	It is still unstable, but we plan to make further improvements in the future.
</p>

<p>
	I need help from people who are familiar with OpenComputers and Python.
</p>

<p>
	Thank you for playing.
</p>

<p>
	<a class="ipsAttachLink ipsAttachLink_image" href="https://oc.cil.li/uploads/monthly_2018_10/2018-10-18_23_17_53.png.720ef985e9ac6c3a451aac8b52db3ba6.png" data-fileid="528" rel=""><img alt="2018-10-18_23.17.53.png" class="ipsImage ipsImage_thumbnailed" data-fileid="528" src="https://oc.cil.li/applications/core/interface/js/spacer.png" data-src="https://oc.cil.li/uploads/monthly_2018_10/2018-10-18_23_17_53.png.720ef985e9ac6c3a451aac8b52db3ba6.png" data-ratio="56.21"></a>
</p>
]]></description><guid isPermaLink="false">1744</guid><pubDate>Thu, 18 Oct 2018 14:26:16 +0000</pubDate></item><item><title>[MC 1.9][OC 1.6] OCMIPS - MIPS-I for OpenComputers</title><link>https://oc.cil.li/topic/882-mc-19oc-16-ocmips-mips-i-for-opencomputers/</link><description><![CDATA[<p>OCMIPS is a mod for OpenComputers which adds a MIPS-I architecture core.</p>
<p>
Status:</p>
<p>
- The CPU itself is mostly complete.</p>
<p>
- It's sorely lacking in software, although Lua 5.3.2 runs (or at least used to).</p>
<p>
- It's got an ELF bootloader EEPROM.</p>
<p>
- I used to be able to boot Lua off a T1 (192KB) stick of RAM when run atop <a href="https://github.com/iamgreaser/mocha" rel="external nofollow">Mocha</a> + libgreen, but I accidentally broke stuff so I still need to fix that.</p>
<p>
- The component API currently sucks. <a href="https://github.com/MightyPirates/OpenComputers/issues/1730" rel="external nofollow">Here's a proposal that should help make it suck less for some components</a>.</p>
<p>
OCMIPS source: <a href="https://github.com/iamgreaser/ocmips" rel="external nofollow">https://github.com/iamgreaser/ocmips</a></p>
<p>
If you want binaries, lurk on #oc and I spit them out from time to time, although <a href="http://magicannon.com/ocmips-march2016.jar" rel="external nofollow">this old one might work</a> (link is for a 1.7.10 version; github should have 1.9 stuff).</p>
<p>
For building a cross compiler, I use binutils + gcc + newlib.</p>
<p>
Feed "--target=mipsel-none-elf" into the configure scripts.</p>
<p>
When building gcc, use "make all-gcc" and "sudo make install-gcc" for the first stage, build newlib, and then continue with "make all" and "sudo make install".</p>
<p>
"--enable-languages=c,c++" should work fine. Fortran support needs to be whacked with a hammer initially so you may want to skip that unless you really need it. Other langs not tested.</p>
<p>
Latest screenshot:</p>
<p>
<img src="https://oc.cil.li/applications/core/interface/js/spacer.png" alt="oR6dzVE.png" data-src="https://i.imgur.com/oR6dzVE.png"></p>
<p>
Cache works!</p>
<p>
<span style="color:#ff0000;">Mod Edit:</span></p>
<p>
Pinned <img src="https://oc.cil.li/applications/core/interface/js/spacer.png" alt=":)" srcset="https://oc.cil.li/uploads/emoticons/smile@2x.png 2x" width="20" height="20" data-src="https://oc.cil.li/uploads/emoticons/default_smile.png"></p>
<p>
~ Liz</p>
]]></description><guid isPermaLink="false">882</guid><pubDate>Tue, 05 Apr 2016 21:26:14 +0000</pubDate></item><item><title>[MC1.7.10][OC1.6+]65C02 architecture "OCMOS", version 0.5.2 released 2017-03-27, beta-quality</title><link>https://oc.cil.li/topic/1243-mc1710oc1665c02-architecture-ocmos-version-052-released-2017-03-27-beta-quality/</link><description><![CDATA[
<p>
	Since I had to write a 65C02 emulator core for work anyway, and since there is still a distinct lack of <em>finished</em> "real CPU" architecture modules for OpenComputers, I just spent the last couple weekends making one. All features that have been tested work, though the testing has not been very thorough.
</p>

<p>
	The Minecraft 1.7.10 version can be found <a href="https://github.com/SolraBizna/j6502/releases/download/v0.5.2/OCMOS-MC1.7.10-0.5.2.jar" rel="external nofollow">here</a>, and the (very dry) documentation for both the hardware and the BIOS is <a href="https://github.com/SolraBizna/j6502/blob/master/OCMOS.md" rel="external nofollow">here</a>. It should build for later Minecraft versions with only minor modifications; I built it for 1.7.10 because that's the version I use. (Source code is <a href="https://github.com/SolraBizna/j6502" rel="external nofollow">on GitHub</a>.)
</p>

<p>
	Please report bugs on the GitHub issue tracker, though don't be surprised if it takes me a while to respond there (GitHub notifications aren't working for me). Feel free to poke me on IRC; SolraBizna on irc.esper.net or irc.tejat.net.
</p>

<p>
	<strong>Features</strong>
</p>

<ul><li>
		Total control over memory usage 
	</li>
	<li>
		Fully persistable
	</li>
	<li>
		Technically supports almost 32MiB of main memory through the MMU*
	</li>
	<li>
		Non-maskable watchdog timer
	</li>
	<li>
		Interrupts occur on signal delivery, allowing interrupt-based signal handling
	</li>
	<li>
		Straightforward memory mapped interfaces for disk drives, redstone, and battery
	</li>
	<li>
		"Serial terminal" allows basic, simple screen-and-keyboard based UIs
	</li>
	<li>
		Support via <a href="https://oc.cil.li/index.php?/topic/1170-oetf-2-universal-interchange-format/" rel="">UIF</a> for <em>all</em> components accessible from Lua, including userdata support
	</li>
	<li>
		Standard BIOS
		<ul><li>
				Very basic interactive debugger, can load S-records either pasted or manually entered
			</li>
			<li>
				Bootloader can boot S-records and binary images from managed and unmanaged drives
			</li>
			<li>
				Basic signal handling for keyboard input, including a blinking cursor
			</li>
			<li>
				Can selectively turn on/off BIOS features from booted code
			</li>
		</ul></li>
	<li>
		User Mode (barely tested) allows memory protection, multitasking—even total virtualization with some work
	</li>
	<li>
		<s>Sync safe</s> (only with a deadline setting of 10ms or so)
	</li>
	<li>
		The CPU has around 512 bytes of built-in memory, allowing simple programs to run without any RAM modules
	</li>
</ul><p>
	*If you dial up the memory amount high enough, you may get disconnection errors due to an oversight in OpenComputers' API. This will hopefully be fixed soon, whether through a workaround in OCMOS or a change to OpenComputers. Memory modules are, by default, smaller than those for Lua computers; in my own testing with two tier 3.5 memory modules (256KiB), I did not experience any disconnects. Meanwhile, since the 65C02 can do so much with very limited memory, you shouldn't experience any serious problems.
</p>

<p>
	<strong>Version History</strong>
</p>

<p>
	0.5.2
</p>

<ul style="color:#24292e;"><li>
		Architecture now has<span> </span><code>NoMemoryRequirements</code><span> </span>annotation, allowing you to build microcontrollers, drones, and robots without memory modules if all you need is the stack and zero page.
	</li>
	<li>
		<code>WAI</code><span> </span>no longer spins pointlessly, and now reduces host CPU usage when called.
	</li>
	<li>
		Now, by default, if<span> </span><code>runThreaded</code><span> </span>runs for longer than one second without meeting the cycle budget, it will give up on doing so and briefly sleep. This prevents degenerate MMU slowdowns from ruining a world or server.
	</li>
</ul><p>
	0.5.1
</p>

<ul><li>
		Works on the server now. (The LAST change I made before releasing 0.5 broke this.)
	</li>
	<li>
		<code>biosOptional</code><span> </span>option means you get the Standard BIOS even if no EEPROM is installed. This is slightly cheaty, but since there's not a crafting recipe for the Standard BIOS yet...
	</li>
</ul><p>
	0.5.0
</p>

<ul><li>
		Initial release
	</li>
</ul>]]></description><guid isPermaLink="false">1243</guid><pubDate>Mon, 20 Mar 2017 00:51:25 +0000</pubDate></item><item><title>DCPU Architecture</title><link>https://oc.cil.li/topic/1229-dcpu-architecture/</link><description><![CDATA[
<p>
	So I have very slowly been making a DCPU Architecture for OpenComputers. If you don't know what DCPU is, it's a fake CPU architecture designed by notch for his discontinued game 0x10c. While all work on the game has come to a halt, there is still alot of interest for the CPU spec which he released.
</p>

<p>
	My idea was to make an emulator that completely follows the spec, including all or most of the devices. This would mean that existing software would work perfectly.
</p>

<p>
	Development is slow as my motivation disappears and returns very briefly. One of my problems is that I can never keep working on one project for long, my interest change sporadically. But I have mostly finished the CPU itself, I haven't tested all the instructions so it's not bugfree. Currently I am working on the devices, specifically the lem1802 (the screen) and the keyboard. The screen works but currently I can't change the colour pallette or change the font(which I don't think will be possible in oc currently). The keyboard is alot more buggy, keys are sometimes doublepressed, not pressed at all, and sometimes just completely break the buffer.
</p>

<p>
	It's not on github atm but if people are interested in the code I'll post the source.
</p>
]]></description><guid isPermaLink="false">1229</guid><pubDate>Sun, 05 Mar 2017 22:19:29 +0000</pubDate></item><item><title>[MC1.7.10][OC1.5.x]ARM Architecture "OC-ARM" (alpha, updated 2016-06-07)</title><link>https://oc.cil.li/topic/572-mc1710oc15xarm-architecture-oc-arm-alpha-updated-2016-06-07/</link><description><![CDATA[
<p>
	OpenComputers architecture module providing a full 32-bit CPU. It simulates a 32-bit ARMv7A processor with a tiny on-die SRAM.
</p>

<p>
	I'm not working on it anymore, and that's not going to change. It's open source, so feel free to fork it and finish what I started. (Start by making things OETF #1 and #2 compliant.)
</p>

<p>
	Current "stable" alpha release is <strong>0.0a3</strong> and can be downloaded <a href="http://github.com/SolraBizna/jarm/" rel="external nofollow">at GitHub</a>. If you're on a UNIX-like (Mac or Linux), you can use <a href="https://github.com/SolraBizna/occross" rel="external nofollow">occross</a> to build cross compilation tools for this architecture. Some useful programs and a build system that can be used to make more of them are <a href="http://github.com/SolraBizna/ocarmrom" rel="external nofollow">also on GitHub</a>. Lua boots, OpenOS runs, and it can mostly install to a hard disk. The whole thing is an exercise in patience; Lua does <em>not</em> run fast on a 500KHz machine, even at one instruction per clock. (Later, if JIT is added, one should be able to up the default speed to the order of several MHz without excessive Minecraft load.)
</p>

<p>
	Missing features, in roughly the order they'd need to be added: Completed test suite, interrupts and exceptions, virtual memory.
</p>
]]></description><guid isPermaLink="false">572</guid><pubDate>Mon, 04 May 2015 01:22:24 +0000</pubDate></item><item><title>Architecture tagging for EEPROMs - feedback requested</title><link>https://oc.cil.li/topic/921-architecture-tagging-for-eeproms-feedback-requested/</link><description><![CDATA[
<p>EEPROMs do not currently have a means of targeting a specific architecture. All of the OC-ARM EEPROMs I've made have had the following structure:</p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">--[==[actual program data goes in here]==]error"This EEPROM is not compatible with Lua computers"
</pre>My ROM mapping code "skips" any --[ followed by zero or more = followed by another [ in the EEPROM. This solution avoids the problem of loading an OC-ARM EEPROM in a Lua computer, but not any other combination. It also takes away 65 bytes that could otherwise be used by the program.<p>I think we need a more general strategy for architecture-specific ROMs. One way to handle this would be to add a "na" (short for Need Architecture) function to machine.lua, and have non-Lua architecture EEPROMs take the exact form (with no extra spaces):</p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">--[==[actual program data goes in here]==]na"Architecture Name"
</pre>Where there can be zero or more =, but the number of = must match on either side. (This allows the number of = to vary on an architecture by architecture or even program by program basis, as needed to prevent the comment from leaking.)<p>The na function could be as simple as:</p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">function na(arch)
  error("This EEPROM requires a CPU running the "..arch.." architecture.")
end
</pre>This would prevent the Lua architecture from running out-of-architecture EEPROMs, without breaking any existing Lua EEPROMs. The na function might also try calling computer.setArchitecture and rebooting.<p>Other architectures would then parse the exact structure above, and check that the "Architecture Name" exactly matches their architecture. If it doesn't, they could crash with an error message equivalent to the above. If it does, they map the EEPROM, skipping as many bytes as are in the initial --[==[ block.</p>
<p>The "Architecture Name" would have to be standardized, to prevent problems. For instance, mine would likely be "OC-ARM", while the other ARM architecture might be "OpenArms".</p>
<p>I'd be happy to write this up as an OETF document, but first I'd like to hear how other architecture devs have handled this problem, and get feedback on this idea in general.</p>
]]></description><guid isPermaLink="false">921</guid><pubDate>Sat, 21 May 2016 17:08:31 +0000</pubDate></item><item><title>How to load a simple ELF file</title><link>https://oc.cil.li/topic/905-how-to-load-a-simple-elf-file/</link><description><![CDATA[
<p>Here's some definitions from the OCMIPS ELF bootloader which you can use for whatever the hell you like:</p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">static const uint8_t e_ident_match[16+8] = 
	"\x7F" "ELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00"
	"\x02\x00"
	"\x08\x00" // Change this to match your architecture
	"\x01\x00\x00\x00";

struct ElfHeader
{
	uint8_t e_ident[16];
	uint16_t e_type, e_machine;
	uint32_t e_version;
	uint32_t e_entry, e_phoff, e_shoff, e_flags;
	uint16_t e_ehsize;
	uint16_t e_phentsize, e_phnum;
	uint16_t e_shentsize, e_shnum;
	uint16_t e_shstrndx;
};

struct ProgHeader
{
	uint32_t p_type;
	uint32_t p_offset;
	uint32_t p_vaddr;
	uint32_t p_paddr;
	uint32_t p_filesz;
	uint32_t p_memsz;
	uint32_t p_flags;
	uint32_t p_align;
};

#define PT_LOAD 0x00000001
</pre>It's only for 32-bit ELF files - 64-bit ELF files have differently-sized fields.<p>For e_ident_match you'll want to change it to match the first 24 bytes of the ELF you're trying to load, assuming you compiled it correctly.</p>
<p>Here's how I build mocha (note the text-segment bit - this is where your ELF will be loaded):</p>
<p> </p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">mipsel-none-elf-gcc -nostdlib -fno-builtin-headers -fno-builtin -Os -G0 -msoft-float -Wl,-Ttext-segment=0xA0005000 -o init.elf ${CSRCS} -lc -lgcc &amp;&amp; \
cp init.elf "${OUTDIR}/" &amp;&amp; \
mipsel-none-elf-strip "${OUTDIR}/init.elf" &amp;&amp; \
mipsel-none-elf-objdump -p init.elf &amp;&amp; \
ls -l init.elf "${OUTDIR}/init.elf" &amp;&amp; \
true
</pre>Do not use dynamic linking. Just statically link it at the address you want it. If you want dynamic linking, do that in your main kernel, not in your bootloader. (It's hard. You normally go through the PT_DYNAMIC section and read your processor-specific ELF supplement to help you with the relocation types.)<p>The general loading process goes like this:</p>
<p>1. Load the header. (Verify the things you want in there.)</p>
<p>2. Use e_phoff to find the program header list, and e_phnum to find out how many program headers there are in the list.</p>
<p>3. Seek to e_phoff, and read e_phnum program header entries.</p>
<p>4. For every program header with a p_type of 1 (PT_LOAD), allocate + zerofill p_memsz bytes at p_vaddr, and if p_filesz is nonzero, read p_filesz bytes from p_offset in the file into p_vaddr in memory.</p>
<p>5. Jump to e_entry... That is:</p>
<p> </p>
<p></p>
<pre class="ipsCode prettyprint lang-auto">((void (*)(void))(ehdr.e_entry))();
</pre>That should be enough to boot a simple ELF from a bootloader. If you want the actual ELF docs, Google is your friend.<p>Actually building the bootloader typically involves writing a GNU linker script and is outside of the scope of this document.</p>
]]></description><guid isPermaLink="false">905</guid><pubDate>Fri, 06 May 2016 07:37:15 +0000</pubDate></item></channel></rss>
