As some of you may know, I'm making my own CPU architecture. I figured I should make a thread for progress updates. Today I'm working on asynchronous I/O. I'm not a 5cr1p+ k1dd13, so the whole thing is being done in C rather than ECMAScript (the generic name for javascript). You may be wondering, "Linux, how are you making asynchronous I/O in a language with no support for asynchronous I/O?" Well, the answer is POSIX threads. Yes, I'm doing a multi-threaded C program. Ugh Code snippet du jour: void *asynctestOne(void *crap) { pthread_mutex_lock(&olock); printf("asunk %d times, this is test one\n", asynctests); asynctests++; pthread_mutex_unlock(&olock); return(NULL); } void *asynctestTwo(void *crap) { pthread_mutex_lock(&olock); printf("asunk %d times, this is test two\n", asynctests); asynctests++; pthread_mutex_unlock(&olock); return(NULL); } void *asynctestThree(void *crap) { pthread_mutex_lock(&olock); printf("asunk %d times, this is test three\n", asynctests); asynctests++; pthread_mutex_unlock(&olock); return(NULL); }
Can you post info on hardware? I find it alot more interesting, especially for a CPU architecture. I have just started working on my own architecture modelled off a real computer (northbridge, southbridge etc.), and not just a bunch off logic gates that add numbers. (well i guess thats all computers do...... So whatever) sorry if i make no sense, I am tired and trying to type with a phone.
Yes, it is a simulator. Unfortunately it has my real name on it, and as such, it will not be distributed on this forum
I call upon the people of this forum to assist me in my asynchronous I/O quest. PM me if interested. You must know C or C++. Thank you
I really don't know anything about simulating this with C, but maybe this Microsoft article could help https://msdn.microsoft.com/en-ca/library/windows/desktop/aa365683(v=vs.85).aspx.
Only input will be asynchronous. This is because output does not need to wait; it can be triggered whenever and it will run immediately. Input will be done in blocks, like the mainframes of old. Code snippet du jour: Code: //vmz/mrl32 assembly code _entry: LSP 4096D LDA &string PSA CLO &strPut HLT string: $'Hello World\n' strPut: XAS DEC XAS PPA XAS ADD 2D XAS XAI DCA <&strPut - 1> getWord: LDI <&strPut - 1> XAI LDR XAI LDI <&strput - 2> SBT 4 JZ &incrementWordCounter BTI <&strPut - 2> JZ &exit DCA 65535 IOC 1 LDI <&strPut - 2> INC DCA <&strPut - 2> JMP &getWord incrementWordCounter: DCA <&strPut - 2> LDI <&strPut - 1> INC DCA <&strPut - 1> JMP &getWord exit: RET
Terminal input is now complete (for now). I wrote a program for the MRL32 that repeats whatever you type, then exits.