BBC BASIC for Windows
« Linux? »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:52pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Linux?  (Read 2142 times)
dfeugey
Guest
xx Linux?
« Thread started on: Jun 11th, 2015, 10:17am »

Quote:
BB4W for Linux. A while ago I asked for somebody to help port BB4W to Linux. You might think this is a worthwhile exercise that would attract some interest, but nothing!

BBW4Linux could be useful to deploy CGI code on a server or for small scripts.

Network would be cool (even if not needed for CGI). Network is always cool smiley

A TeletextPlus mode with Unicode and larger Windows, compatible with Linux and Win32, would be great for console UI. But there is also the possibility for users to print VT codes.

Graphics and sounds are funny, but there is Wine here.
User IP Logged

rtr2
Guest
xx Re: Linux?
« Reply #1 on: Jun 11th, 2015, 12:02pm »

on Jun 11th, 2015, 10:17am, dfeugey wrote:
BBW4Linux could be useful

I am still very interested in collaborating with somebody to create a native (32-bit) Linux version of BBC BASIC. As previously discussed I would make available, free of charge, the BB4W interpreter in the form of OS-independent relocatable object modules. The other party would have the responsibility of writing the 'interface layer' between those modules and the Linux kernel.

The interface could be in pure assembly language or in (for example) C with an assembler wrapper to support the required ABI. Initially this could be a console/CGI-only implementation with graphics, sound, etc. temporarily routed to a 'Not yet implemented' stub.

Anybody interested would need to be enthusiastic about BBC BASIC, knowledgeable about Linux at the kernel (syscall) level, and be able to program in x86 assembly language (or at least C). If you are in that category please contact me privately.

Richard.
User IP Logged

dfeugey
Guest
xx Re: Linux?
« Reply #2 on: Jun 11th, 2015, 2:53pm »

on Jun 11th, 2015, 12:02pm, g4bau wrote:
If you are in that category please contact me privately.

I program in C, but I'm not on Linux kernel things. Sorry.
Anyway, ASM is more direct for kernel syscalls. You don't even need a wrapper.

IMHO, for a portable core, there is another solution than a wrapper. For example, a lib that will embed definition of some core keywords. With some old versions of BBC Basic, a DEFPROC PRINT was able to redefine (or define) PRINT. With this approach, you can have an almost I/O less core, then put almost all I/O in a non portable lib. For example a call to sys_write for a Print, etc.

Not an easy choice.
User IP Logged

dfeugey
Guest
xx Re: Linux?
« Reply #3 on: Jun 11th, 2015, 3:07pm »

Anyway, to be honest, I don't think it's a priority.
The main point is more code, to attract users (again).

Why did I come to BBC Basic 4 Win (except from the fact I use RISC OS)? Midi examples. Clear and easy to use. The same was not available under my previous programming tool (Xojo).

Unfortunately, a lot of BBC4Win websites are down now.
I hope to be able to help - a bit - here.
User IP Logged

rtr2
Guest
xx Re: Linux?
« Reply #4 on: Jun 11th, 2015, 3:55pm »

on Jun 11th, 2015, 2:53pm, dfeugey wrote:
You don't even need a wrapper.

You need a wrapper because the ABI used by my BBC BASIC interpreter is non-standard (pretty ad-hoc really, as it has evolved from the old Z80 version through the 16-bit 8086 version to the 32-bit x86 version). So, as I'm not proposing any source code changes at all, that ABI is a non-negotiable feature of any Linux port!

Quote:
With some old versions of BBC Basic, a DEFPROC PRINT was able to redefine (or define) PRINT.

I don't think that was true of any Acorn versions, and it certainly has never been true of mine, so perhaps you are referring to Brandy or some other 'unofficial' BBC BASIC clone.

Quote:
With this approach, you can have an almost I/O less core

All 'official' implementations of BBC BASIC, going right back to the original 6502 version in early BBC Micros, have kept the 'language' entirely separate from the 'OS', all I/O being via defined software interfaces. That "choice" was made about 34 years ago. smiley

Richard.
User IP Logged

dfeugey
Guest
xx Re: Linux?
« Reply #5 on: Jun 11th, 2015, 9:46pm »

Quote:
I don't think that was true of any Acorn versions, and it certainly has never been true of mine, so perhaps you are referring to Brandy or some other 'unofficial' BBC BASIC clone.

I clearly remember of Sophie's statement around the fact that with the ARM version of BBC Basic, we did loose the capacity to 'rewrite' keywords. It was possible by design, and then it became impossible, by design again.

Of course possible does not mean it's easy to do. Anyway, I can't remember if I saw this in some source code, interview or forum, but I clearly have some discussion around this. Probably with Steve Drain.

Quote:
All 'official' implementations of BBC BASIC, going right back to the original 6502 version in early BBC Micros, have kept the 'language' entirely separate from the 'OS', all I/O being via defined software interfaces. That "choice" was made about 34 years ago. smiley

A good one.
User IP Logged

dfeugey
Guest
xx Re: Linux?
« Reply #6 on: Jun 11th, 2015, 10:15pm »

on Jun 11th, 2015, 3:55pm, g4bau wrote:
You need a wrapper because the ABI used by my BBC BASIC interpreter is non-standard (pretty ad-hoc really, as it has evolved from the old Z80 version through the 16-bit 8086 version to the 32-bit x86 version). So, as I'm not proposing any source code changes at all, that ABI is a non-negotiable feature of any Linux port!

So forget the idea. There are strict rules around ABI. For binary blobs, mechanisms change with each major version of the kernel. That means a new wrapper each time there is a change in the kernel.

http://fr.wikipedia.org/wiki/Application_binary_interface#/media/File:Linux_kernel_interfaces.svg

Raw ASM code should work unchanged under Linux. So everything not connected to I/O, or the kernel's ABI. Generic code can connect - with specific bridge - to the kernel. The only solution is to define the wrapper as a kernel module. You'll need to adapt it to every version of the kernel.

Kernel module is a 'no go' for such a project, because it's too dangerous. No one will accept to integrate it inside the standard kernel. And you'll have problems to synchronise versions of the wrapper and the binary blob.

So much work that it would be probably easier to make a runtime in C (slower, but more portable) for non Windows versions of your flavour of BBC Basic smiley
User IP Logged

rtr2
Guest
xx Re: Linux?
« Reply #7 on: Jun 11th, 2015, 11:33pm »

on Jun 11th, 2015, 10:15pm, dfeugey wrote:
Kernel module is a 'no go' for such a project, because it's too dangerous. No one will accept to integrate it inside the standard kernel.

Nobody is suggesting such a crazy approach, any more than BBC BASIC for Windows needs to be integrated with the Windows kernel!

The assembler wrapper idea is perfectly workable: the interface with the existing interpreter would necessarily use the custom ABI that BB4W uses, and the interface to Linux would use the int 0x80 syscall API. The wrapper would simply do the necessary data munging.

I am not proposing anything complicated or dangerous. By keeping the source code identical to BB4W the risk of introducing bugs is substantially eliminated, and by supplying relocatable object modules I can make the interpreter available without jeopardising my IPR.

I will just have to hope that one day somebody with a positive attitude to this proposal will come along.

Richard.
User IP Logged

dfeugey
Guest
xx Re: Linux?
« Reply #8 on: Jun 12th, 2015, 08:26am »

on Jun 11th, 2015, 11:33pm, g4bau wrote:
The assembler wrapper idea is perfectly workable: the interface with the existing interpreter would necessarily use the custom ABI that BB4W uses, and the interface to Linux would use the int 0x80 syscall API. The wrapper would simply do the necessary data munging.

I did not make kernel things for years under Linux, but I don't think it's possible. IMHO, you can't call external ASM code from a wrapper, if this code is not compiled inside a DLL or other ELF content (or run as root). All other type of loads are limited to data only.

The kernel and tools as SELinux will not let you execute data as code. The only way to achieve this goal would be to compile the wrapper as a kernel module (I do not say that BBC Basic should be a kernel module. Just the wrapper).

Of course, I can be wrong on this subject, but I'm pretty sure I'm not. I can't remember of any example of non elf binary blob that will run without a specific kernel module.
« Last Edit: Jun 12th, 2015, 08:29am by dfeugey » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls