Feasibility of this as my first "project"?
Pages: 1 2
David Jordan (2235) 12 posts |
An archmedies was my first computer back in the early 90s as a six or seventh birthday present and now I find myself with a raspberry PI and flooding back memories… Anyway I fancy having a go at doing things, my idea for a first “project” to show myself around RISC OS would be to extend the operating system such that one could hide the pling, much like how in the more “popular” operating systems file extensions can be hidden in explorer/finder/whatever – i.e. you would see !Writer as Writer. I am PRESUMING that this will be both relatively straightforward to do conceptually and not involve all that many LOCs, yet would also not be trivial in the sense that I would have to go to a relatively low level to properly achevieve this. What are your thoughts? FWIW I am reaonsably accomplished at C/C++ but my only experience with ARM assembly is programming a clock six or seven years ago at university… I am not asking “how to” do this but would certainly appreciate some pointers for the bits of the API documentations to look up if that comes to mind. |
Martin Bazley (331) 379 posts |
I don’t see the need for such a feature, myself (I always turn off the ‘hide extensions’ feature elsewhere, it’s asking for trouble), but I’ll tell you something which a lot of people really would find useful and shouldn’t be all that much more complex – implement an option in the Filer to turn the newly-implemented keyboard shortcuts on and off. At present, Filer windows claim the focus if you click in them, which is a change from the old behaviour and one which many people find annoying. |
Colin (478) 2433 posts |
Yes please I’d like to turn off filer key shortcuts too. The way I work makes no use of the keyboard shortcuts and has illicited many a groan as the focus moves to the wrong window. I’ve already lost files with ctrl-K in edit because the filer was highlighted and I hadn’t realised it. |
Steve Pampling (1551) 8170 posts |
Sounds like a good reason for not having ctrl-K in edit and using ctrl-X and ctrl-C etc. Admittedly focus grabbing is totally non-RO ethos |
Theo Markettos (89) 919 posts |
David, you might want to think about how you plan to do this. I’m assuming this is a learning exercise rather than something you would necessarily want committed to the tree. For example, you could do it in the Filer alone. That would mean the plings would still exist in pathnames that apps see, but just wouldn’t show in the Filer windows. If you open up a file like ! Writer.!Run then those plings would still be visible in an editor. It might be as simple as just making the Filer remove the ‘!’ when it draws its icons. Since the Filer draws its own icons rather than creating them where the rest of the Wimp can access them, you don’t have the problem where it might be trying to read back the icon contents and so get confused. Or you could intercept the file level calls so that apps don’t see the plings. That would be much messier I suspect. What if I have two objects Writer and !Writer. How to tell the difference? Here’s the Filer source code: |
andym (447) 473 posts |
Doesn’t !PhotoFilr do this already, as one of its configurable options? Edit: It does… |
Rick Murray (539) 13840 posts |
Whoo. That’s a pretty ambitious first project. ;-)
Question is – how far would the ‘!’ be hidden? In the filer display (shouldn’t be too hard to do) or in the command line itself? If in the command line, you risk running into problems if the application name shares the name of an existing file, as mentioned by Theo. Don’t forget, also, that regular files can have an ‘!’ at the start. I sometimes use this to force stuff to a specific place in the sort order; like !Help will be up there at the top before all the other rubbish that comprises an application.
Personally, I am violently opposed to filing systems removing information because they think that dumbing the system down is making it better. No, it makes it better for stupid people who don’t know why it was like that in the first place. Ever tried to rename a file with extension hidden on Windows (XP)? Let’s say you downloaded a file called “cutekitten.jpeg” (appears as “cutekitten”) and the photo printer booth at the supermarket refuses to recognise the file. The solution is simple, rename the file to have the “.jpg” extension (because the photo booth is an ill-conceived piece of …..). So you do that. You’re happy, it now says “cutekitten.jpg”. The photo booth still refuses to work because your file is actually now called “cutekitten.jpg.jpeg”. RISC OS applications are identified by the ‘!’. I think learning how to remove them would be an interesting project (I’m all for learning and customising stuff), but I would not like to see such a feature in the mainstream release. |
Rick Murray (539) 13840 posts |
Perhaps what is needed is for the filer to prompt “are you sure” regardless of the confirmation setting when the keyboard shortcut is used? Opening a menu on a file, going to the file entry, moving to “Delete” and clicking. It is a very deliberate action. |
Steve Pampling (1551) 8170 posts |
The operative bit is “lack of built-in “trashcan”” |
patric aristide (434) 418 posts |
I sort of remembered something called blackhole but !Store, PacMan and Google drew a blank. P.S.: sorry for the OT |
David Jordan (2235) 12 posts |
Thank you all for your replies. Yes, to be clear I was not proposing/requesting this as a feature in the next build – hidden file extensions irritate me immensely as well, in fact, and there is no way I would actually use this myself – it was just something that came to mind as something to try out, initially by altering Filer and then possibly going further down the rabbit hole as far as removing plings entirely and having them as a bit in folder metadata (assuming it’s at all practical to add extra metadata for folders in the filing system – I really have no idea) However, if there is a simple project like disabling keyboard shortcuts that there is demand for then I see no reason I shouldn’t try doing that instead, in fact I’d much rather do something useful! I assume that if tonight I buy the Nut Pi add on including the Desktop Development Environment then I will be good to start working on this (depending on other commitments) on, say, Wednesday? Or do I need some other tools as well? Obviously given the time of year I’m pretty busy but from next week I’ve a fortnight off work and drunken distant relatives to avoid :D |
Steve Pampling (1551) 8170 posts |
http://bracke.dk/desktop-enhancements But the Hole350 module needs modifying for 32 bit use, the front end BASIC has a dependency on ADFS SWIs being available and the screensaver element of the bundle needs a replacement CompoSupport to replace the “Foggy” module. The Hole350 I hacked to add the correct header and changed a couple of MOVS to MOV – seems stable on RPCEmu and Beagle. Swapped the newer CompoSupport in – the savers seem a bit fast Twiddled the BASIC just enough to stop the error and give control of the bits I wanted to play with. I think the whole bundle is a bit OTT and the Hole520, well I had to call it something different :), needs a multiple file delete/rename so the same filename deleted several times produces file01, file02, file03 etc Maybe OT, but something like a filer mod to give a built in shortcut / symbolic link feature might be a nice small project. |
David Jordan (2235) 12 posts |
I am going to treat this thread a bit like a blog, if that’s ok. Except a blog where hopefully (so long as I am not too boring or foolish) I get a good deal of input along the way. I am starting out by reading the RISC OS 3 development guide at the foundation. Please let me know fairly soon if this is a terrible idea with almost none of it applying any more… I appreciate that the address bus on anything relevant is no longer 26 bits. With respect to the shortcut idea (I don’t think full on symbolic linking is practical but again I’m making assumptions) that also sounds like a doable first project, probably a simpler one in fact. Have till Wednesdayish (I assume – haven’t placed order for the SD card yet until someone confirms it’s what I need) to make a final decision. |
Rick Murray (539) 13840 posts |
Wow. That’s organised. …usually a 1am “one last thing”1 session when I have to get up at 8am to go to work. <sigh> 1 Which will be what I said at 10pm. And 11pm. And midnight. (^_^) |
Rick Murray (539) 13840 posts |
Which means MOVS and TEQP PC and LDMFD R13!, {…}^ are no longer valid. Pushing and making bits from R14 also invalid. You use MSR/MRS and the CPSR/SPSRs. Which means to take care when switching modes manually to request a 32 bit mode (ie the mode bits in examples are different). Plus the API has changed slightly with regards to preserving registers, or not. |
Steve Pampling (1551) 8170 posts |
Ah, early finish.
I believe the comments elsewhere hold true, in spades, that if you’re working in C let the compiler do it, if you’re working in BASIC then Mr Wurthner has some nice macros published and if you’re working directly in assembler then you know what you’re doing and don’t need advice. |
David Jordan (2235) 12 posts |
Not to bang on about this but is all the stuff I need on that SD card*? If folk are hesitant to answer for some reason then I forgive you in advance ;) *I appreciate that in one sense, technically everything I need is around by looking at the source code in gedit on my *nix laptop and visualising the entirety of risc os in my head, and in another sense what I really need to be is the head of Acorn in the early 1990s. But you know what I mean… BTW I have ordered – well, will order within 5 minutes of typing this post – the SD card because the other stuff will come in useful in my RISC OS adventures no doubt and it’s only £35, but I do want to be sure… |
Chris Gransden (337) 1207 posts |
The NutPi SD card contains the DDE which has everything you need to build a RISC OS ROM. |
David Jordan (2235) 12 posts |
Thank you. |
David Jordan (2235) 12 posts |
“Blog”: The Pi arrived today and I got home from work around half six. A bit of messing around in raspbian and then onto the proper operating system, RISC OS (the one included on the NOOB SD, not the one that is hopefully arriving tomorrow or the day after). I intended to “do something” with it but haven’t – I have been reading the excellent Fox book included with it about WIMP and played around with some BASIC, but to be perfectly honest I am not going to code anything significant in a language as archaic as BASIC – even though BBC Basic (on a real BBC) – was the language of the first ever program I wrote (hint: it included “20 GOTO 10”) unless I absolutely have to – I’m intending depending upon what I find out in the next while about how these shortcut keys are processed to either use C or assembly, preferably the latter. Am pleasantly surprised to see that php is on RISC OS and a relatively recent version – I have some household software I have written in PHP, albeit using 5.4 features, which basically manages the contents of the kitchen, shed etc (and yes it uses mysql as well so I will have to come up with something there, still, this is months in the future) too… I only mention this because, as I said, I will treat this thread a bit like a blog. Updates to follow either tomorrow or the next day I hope. Anyhoo back to the book. By the way I have utterly failed at getting the sprites to work to be my program icons (i.e. I can save them with the right file and sprite names in the right sizes, but they don’t appear) and I cannot see what I am doing wrong – and fwiw I have looked at other programs’ sprites and cannot see any difference with what they’re doing. Sorry I can’t really be more specific but are there any common pitfalls? Maybe colour depth, I think to myself as I type this? |
Chris Evans (457) 1614 posts |
Your sprite problem could be that the !Sprites & !Sprites22 files are loaded and cached when the directory containing them is first opened. I think you would need a shutdown/restart for the new sprites to be loaded. |
Dave Higton (1515) 3525 posts |
Much as I have enjoyed assembly language programming in the past, my advice would be to avoid assembly language. C is more portable between processors in the ARM family. It’s also much more productive; you can abstract yourself to a higher level. |
David Jordan (2235) 12 posts |
Blog: “Various things have happened” but I shall describe them in a fuller update. For now, I’d just like to say I was very impressed with how quickly RiscOS Open got back to me with my email about where my RiscOS SD Cards had got to. 4 minutes it took for a response and that after 9pm! (BTW, I’m not sure about whether this site in itself, rather than the RiscOS project, wants volunteers or not but if you are after volunteer contributions and would like me to add despatch/tracking stuff to your order process to avoid these kinds of enquiries in the future, given it’s aLmost certainly very boring stuff^+ you don’t want to be bothering with yourself and doing things like it happens to be my 9-5 type of thing, you know how to get in touch ;) ) ^+Actually, it is definitely very boring stuff. |
Richard Walker (2090) 431 posts |
David, As a sort-of ‘newcomer’, I think RISC OS could benefit hugely from your findings on this path. Even if a lot of it comes down to getting some of the documentation improved… it would be a step forward. We should aim to make it as easy as possible for someone to know what to buy and where to start, if you want to start contributing. |
David Jordan (2235) 12 posts |
I hope so Richard, that’s one reason I’m going into such detail. However, I am now rather unlikely to update this till Tuesday at the earliest as the SD Cards still haven’t arrived* and it being the time of year that it is I am busier than I really want to be. *and one recommendation I am going to make is to add expedited shipping as an option, at least while upgrading the OS is quite difficult when it’s being buggy anyway (although I have managed to upgrade to the version released today myself using the instructions @ http://duinsoft.nl/pi.php – only once I cut out all ethernet traffic other than TCP/IP mind – otherwise it would die constantly). I for one would certainly pay for it ;) |
Pages: 1 2