Giter Site home page Giter Site logo

pycorn's People

Contributors

bouteillebleu avatar cmbarker83 avatar tornewuff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycorn's Issues

Rapsberry Pi as target

Allow to compile and run Pycorn on the Rapsberry Pi board. I have in background since a lot of time to port PyMite to the Rapsberry Pi, but I don't have the time or the ARM knowledges to do it (but I was able to port it to x86 using QEmu , by the way :-) ).

Since my long term purpose was to develop a pure-Python OS over it just from drivers up to process scheudler (more or less the same that Pycorn long term purpose), it would be good to allow it to run over different platforms and interpreters, both for comparation purposes and interoperability.

FatFS module

Develop and add a module to access to FAT filesystems using the FatFS library so we can have a basic filesystem where to start working on. Maybe it's not the perfect one (I would prefer to develop a custom RAM-based ObjectStorage that automatically does a persistent store of the Python objects, deleting any conception about volumes or storages or anything), but it's enough for the current stage of the project. Info about how to compile it for Raspberry Pi on their forums.

Regarding to the API, we can use the FatFS native one, or use the PyFilesystem project (I used it in the past and like the concept, but dislike their focus on high level inexperienced users making it dificult and very ineficient for low level developers), or develop our own one, putting atention on versatility in a similar way PyFilesystem or FUSE try to achieve, eficiency and pythonic style (for example, seeing and accessing directories as dict objects, or more agresively, directly as plain set objects, that's more close to the reality and low level concepts).

Issue when creating u-boot script

I use mkimage.py to create boot stcipt for arm platform (unrelated to pycorn).

Mkimage from Ubuntu 16.04
mkimage -A arm -O linux -T script -C none -n "bootscript" -d boot.script u-boot.scr

00000000  27 05 19 56 18 76 24 35  5b 89 19 25 00 00 00 48  |'..V.v$5[..%...H|
00000010  00 00 00 00 00 00 00 00  75 42 39 3a 05 02 06 00  |........uB9:....|
00000020  62 6f 6f 74 73 63 72 69  70 74 00 00 00 00 00 00  |bootscript......|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 40 00 00 00 00  31 31 31 31 31 31 31 31  |[email protected]|
00000050  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000060  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000070  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000080  31 31 31 31 31 31 31 0a                           |1111111.|
00000088

mkimage.py
python mkimage.py -A arm -O linux -T script -C none -n "bootscript" -d boot.script u-boot.scr

00000000  27 05 19 56 94 43 04 e9  5b 89 19 0b 00 00 00 40  |'..V.C..[......@|
00000010  00 00 00 00 00 00 00 00  fb fa 04 76 05 02 06 00  |...........v....|
00000020  62 6f 6f 74 73 63 72 69  70 74 00 00 00 00 00 00  |bootscript......|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000050  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000060  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 31  |1111111111111111|
00000070  31 31 31 31 31 31 31 31  31 31 31 31 31 31 31 0a  |111111111111111.|
00000080

Look like mkimage.py skips length and some padding.

I fixed it for my project, but not tested it thoroughly c1f634e.

Field._cachedvalue not initialised leading to errors when reading registers e.g. main_id

Reproduction steps:

  1. makepp seeds/pycorn/pycorn.uimage (to build the Pycorn image)
  2. makepp seeds/pycorn/run (to launch it in qemu)
  3. Type the following into the interpreter:

from metal import cpu
cpu.SystemControlCoprocessor.main_id.implementor

You get the following error:
Traceback (most recent call last):
File "", line 1, in
File "/initrd/metal/bits.py", line 65, in get
File "/initrd/metal/bits.py", line 46, in extract
TypeError: unsupported operand type(s) for &: 'NoneType' and 'long'

From looking into this, this is because:

  • Field.get returns self.bits.extract(obj._cachedvalue) where obj is the instance.
  • Bits.extract does a bitwise and between the bitmask for the field and the contents of Field._objvalue.
  • But Field.init doesn't set self._cachedvalue, only Field.set does.

So if I'd set the values of a field first I'd expect this to be okay.

But in a read-only register like main_id, it doesn't make sense to do that - and yet nowhere in setting up the register does self._cachedvalue gets set, so any attempt at get on any of main_id's fields will cause a TypeError.

Project needs a logo

Pycorn needs a nice logo. The obvious thing is some kind of visual pun involving snakes and something that doesn't too closely resemble the Acorn logo (http://en.wikipedia.org/wiki/File:AcornComputersLtdLogo.jpg) but one better (and less trademark-infringe-y) option would be to instead imitate the style of the BBC Micro logo (http://en.wikipedia.org/wiki/File:BBC_owl.svg) to draw something Pythonic :)

Vector format, ideally svg, would be preferred.

There were some proposals on the old bugtracker: https://bugs.launchpad.net/pycorn/+bug/319616

Embryo should use the memory atag.

The bootstrap assumes it's okay to allocate pages from the space after where the rom was loaded. The ARM linux boot protocol kinda guarantees that 16KB of ram is available below the beginning of the rom, which we use, but nothing else (and even this doesn't exist in xip). It should instead parse the ATAGs to find where physical ram is.

We also don't work in XIP configs or if loaded to a non-page-aligned address...

Toolchain libraries aren't target-specific

libgcc and newlib get built for generic ARM, without any machine-specific CFLAGS. It would be nice if it could optimise them for the machine being used, but this would make them machine-specific and the structure and docs would need updating to match.

This is particularly relevant for the raspberry pi port, which won't be able to use the hardfloat ABI otherwise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.