Jump to content

mjsmith

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by mjsmith

  1. Thanks for the reply and I'd love to see the operating system. My original simple OS idea was something far more hardcoded. That is, every task was predefined, not dynamically loaded etc. It would have a hardcoded limit of something like 4 tasks and would switch on them. This way their program locations, state information, stacks etc. would all be known at compile time. Basically it would be an operating system from the 1940s lol. Yours sounds far more sophisticated. The compiler design definitely seemed a bit odd but I can't blame you for that. See: https://github.com/mjsmith707/InterpretedCPU/tree/master/Assembler/Assembler for a single night assembler implementation of dubious quality . Shortly after working on yours I realized how much modification would probably be needed to properly implement structs and others. I'll probably revisit writing code for ProgCom when I've got some free time but I am highly allergic to large project assembly programming lol so instead of focusing on my weak point (compiler design) I decided to focus on something I'm a bit more comfortable with: A MIPS32R2 emulator. Only been working on it for about 3 days now but it supports (albeit unverified, needs unit testing) roughly 65% of the ISA. It is about the most basic of designs at this point. A directly interpreted, single-cycle, non-pipelined, non-caching implementation. It can however decode and execute mips32r2 machine code (testing with GCC cross-compiler) so it's off to a good start in that respect. I'm planning on implementing the coprocessor0 stuff in the near future and then interrupts. Both of those should be relatively easy. A proper MMU implementation will likely be a bit more difficult but I'll get to that, floating point and some basic device emulation later. The ultimate goal is full compatibility but I'd settle for just getting very very early Linux or NetBSD boot output as validation. Performance will certainly be lousy as its directly interpreted but as long as it's good enough to target with GCC I'll be happy. It's being written in C# (for eventual implementation as a KSP plugin) and all help is welcome if you're interested. I'm using Xamarin and dumped the whole project on it. https://github.com/mjsmith707/Standalone_MIPS_Emulator
  2. Fell off the map here. Busy busy. Currently taking an operating systems class for college and was wondering how your progress on this and progcom has been? Thinking about making a simple OS myself given enough time (i.e. Summer). Its been quite awhile since I looked at the docs for progcom so I can't remember the major limitations but hopefully it would be preemptive not cooperatively driven. Like you described, interrupt handler, dispatcher/scheduler and maybe some i/o routines would be the goal. *edit* Did some basic investigation. I think this would be exceedingly time consuming without struct support in the compiler. Also I couldn't find documentation on if it supported macros or not (I know the assembler does). For now I might just start by seeing if I can add struct support. Then move onto writing a simple malloc/free. *edit2* Added extremely rudamentary and incomplete struct support. It's basically variable renaming at this point. No global support, no pointer support or member pointer support. Probably numerous other limitations and will need a proper redo (a bit more comfortable with the compiler layout now). Fork here: https://github.com/mjsmith707/KSPCompiler
  3. Sounds awesome. I'd love to see the simple os (minix based?). Also as somewhat of a feature request, maybe page flipping if feasible. I implemented double buffering and while it works pretty well, there's definitely a performance hit Also on that note, I had my back buffer mapped to a memory address range that should be way out of bounds (138265). I thought the max address (as defined in libLabel) is 65535 or am I missing something? Not sure how I came up with that address either.
  4. Hey thanks a bunch! After awhile r and a start to look the same I went ahead and replaced all the muls/divs with shifts as well as hopefully made it compliant to your calling conventions. Also removed some unnecessary code. That third condition was one such, suggested as being needed on that talk page but it isnt. That drawPixel mov is also unnecessary and has been removed. You've been a huge help. I'm still not sure what I will actually do with any of this but it's been fun nonetheless. Updated libDraw with some changes/optimizations. A call to initializeDraw is now required at the beginning to set the display mode. Not sure if I'll keep it this way but I wanted to move that out of clearScreen for performance reasons. Added circles. Wohoo. Slightly modified your drawing test. libDraw.txt - http://pastebin.com/jth4Bi4a drawTest.txt - http://pastebin.com/jYvD6cjE
  5. Hey thanks a bunch for the reply. That seemed to help quite a bit. I've now implemented a few routines for a drawing library (drawPixel, fillScreen, clearScreen, and drawLine). drawLine is not really finished unfortunately. Seems to fail horribly with positive slope among others hehe. http://pastebin.com/Nj09Cm73 - There's my drawing library libDraw. http://i.imgur.com/1WLXaKy.png - There's an example of it in action. http://pastebin.com/BWuwLGSd - The code for that image. It has a very very long way to go (and its not even remotely optimized) but I'm pretty stoked for it to draw lines If you have some free time and can figure out why it bombs out on certain coordinates let me know. The template algorithm pseudocode I used can be found here: http://en.wikipedia.org/wiki?title=Talk:Bresenham%27s_line_algorithm#General_Line_drawing_algorithm I'm sure it has something to do with a poorly written branch
  6. Looked again today. Looks like the bl and ble instructions don't work for negative integers. Is this a bug or by design? Undocumented regardless (afaik). .text #include libText.txt #global main main: movi r1, -5 ; r1 = -5 movi r2, 7 ; r2 = 7 bl r1, r2, less ; if (r1 < r2) goto: less movi r1, 70 ; r1 = F alse call putChar ; Print halt ; Halt less: movi r1, 84 ; r1 = T rue call putChar ; Print halt ; Halt Should print T, prints F. Changing -5 to 5 will print True.
  7. This mod needs so much more love I started on a pretty basic drawing library but ran into issues when trying to write an absolute value function. Is there something wrong with the shift right arithmetic instructions or am I just tired? This has been fun to mess around with. Haven't done any assembly since my class last Fall and I've never implemented stuff like Bresenham's algorithms in any language regardless.
×
×
  • Create New...