[Oberon] Oberon Digest, Vol 128, Issue 8
Bill Buzzell
captbill279 at gmail.com
Sat Jan 10 21:09:57 CET 2015
Hi Chris,
Great to hear from you.
>I used BlackBox Component Pascal v1.6 on Windows 7 as much of the Project
Oberon source code (Files.mod and FileDir.mod) can be used with minimal
changes, SYSTEM.VAL is compatible with Project Oberon and BlackBox has
access to the relevent WinApi system calls:
What about an Astrobe based solution? How about the MMC.Mod to handle it? I
have been wanting to use an LPC1768 in between the FPGA and the NRF24l01
and use the LPC1768 as a type of SPI switcher. I want to be able to toggle
from the network card to whatever SPI module I may want to utilize using
the (only) available SPI channel. Perhaps I should be considering adding
the Oberon fs functionality as a utility function. Seems like a perfect
place for these types of tasks. I am already looking at doing a 'flash
utility' just like this.
I am wondering if this would be an easier approach for me vs. using
BlackBox? I have installed BlackBox but have little experience with it. I
like the 'hardware/peripheral' approach of using Astrobe and interfacing
over serial if possible.
I am still trying to consider the details. Astrobe will need to be able to
speak to the Oberon SDcard directly (ideal) or simply use two SDcards, one
on the FPGA and another on the MC.
Any thoughts or concerns with this approach?
Best Regards,
Bill
On Sat, Jan 10, 2015 at 6:00 AM, <oberon-request at lists.inf.ethz.ch> wrote:
> Send Oberon mailing list submissions to
> oberon at lists.inf.ethz.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> or, via email, send a message with subject or body 'help' to
> oberon-request at lists.inf.ethz.ch
>
> You can reach the person managing the list at
> oberon-owner at lists.inf.ethz.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Oberon digest..."
>
>
> Today's Topics:
>
> 1. Project Oberon - Copying files to the SD card (Chris Burrows)
> 2. Re: Project Oberon - Copying files to the SD card (J?rg Straube)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 10 Jan 2015 09:22:36 +1030
> From: "Chris Burrows" <chris at cfbsoftware.com>
> Subject: [Oberon] Project Oberon - Copying files to the SD card
> To: "ETH Oberon and related systems" <oberon at lists.inf.ethz.ch>
> Message-ID: <000f01d02c5e$f733cee0$e59b6ca0$@cfbsoftware.com>
> Content-Type: text/plain; charset="utf-8"
>
> >
> > From: Bill Buzzell [mailto:captbill279 at gmail.com]
> > Sent: Thursday, 8 January 2015 4:51 AM
> > To: oberon at lists.inf.ethz.ch
> > Subject: Re: [Oberon] Oberon Digest, Vol 128, Issue 6
> >
> > How do you move files onto the SD card? Anyone know? I tried
> > extracting the ISO and adding files and un-extracting it again. None
> > of the files appear visible to Oberon though. Am I using the wrong
> > encoding somehow?
> >
>
> If you want files on the SD card to be visible from Project Oberon then
> you need to create them with the appropriate file headers and directory
> entries as explained in great detail in Chapter 7 The File System of the
> Project Oberon documentation.
>
> You should write a program to do this on the system you want to transfer
> files from. As the Project Oberon source code is provided most of the hard
> work is already done for you. However, before you do this you need to
> understand:
>
> a) how to access the SD Card on your system
> b) how to perform low-level block IO to / from a storage device on your
> system
> c) the Project Oberon modules Files, FileDir and the disk IO procedures
> from Kernel.
>
> I used BlackBox Component Pascal v1.6 on Windows 7 as much of the Project
> Oberon source code (Files.mod and FileDir.mod) can be used with minimal
> changes, SYSTEM.VAL is compatible with Project Oberon and BlackBox has
> access to the relevent WinApi system calls:
>
> http://www.oberon.ch/blackbox.html
>
> If you plan to transfer files from a Windows 7 system to / from the SD
> Card the following should help get you started:
>
>
> a) how to access the SD Card on your system
>
> If you cannot access the SD card via SPI on your system you need to find
> out how to access it as a raw (i.e. not formatted) device. On Windows the
> device name convention is \\.\<drivenumber>. On my system the drivenumber
> is "6" because my SD card appears as Drive 6 in:
>
> Admin Tools > Computer Management > Storage > Disk Management
>
> The 8GB Project Oberon SDHC Card appears with a 255MB FAT partition, a 64
> MB Primary partition and 7.09GB unallocated
>
>
> b) how to perform low-level block IO to / from a storage device on your
> system
>
> The corresponding BlackBox procedure to access this drive using
> WinApi.CreateFileW is:
>
> PROCEDURE Open*(driveName: FullName);
> VAR
> physicalName: FullName;
> BEGIN
> physicalName := "\\.\" + driveName;
> drive.handle :=
> WinApi.CreateFileW(
> physicalName,
> WinApi.GENERIC_READ + WinApi.GENERIC_WRITE,
> WinApi.FILE_SHARE_READ + WinApi.FILE_SHARE_WRITE,
> NIL,
> WinApi.OPEN_EXISTING,
> {},
> 0)
> END Open;
>
> You also need to implement the equivalent of the low-level sector read /
> write functions (i.e. Kernel.GetSector and Kernel.PutSector). On Windows
> the WinApi calls you can use to do this are
>
> WinApi.SetFilePointer
> WinApi.ReadFile
> WinApi.WriteFile
> WinApi.GetLastError
> WinApi.CloseHandle
>
> e.g PutSector becomes:
>
> PROCEDURE PutSector*(sectorNo: INTEGER; sector: ARRAY OF BYTE);
> VAR
> i, org, count, bytesWritten, res: INTEGER;
> BEGIN
> ASSERT(sectorNo MOD 29 = 0);
> sectorNo := sectorNo DIV 29;
> sectorNo := sectorNo * 2 + FSoffset;
> org := sectorNo * (SectorSize DIV 2);
> i := 0;
> i := WinApi.SetFilePointer(drive.handle, org, i, WinApi.FILE_BEGIN);
> count := SectorSize;
> IF (WinApi.WriteFile(drive.handle, SYSTEM.ADR(sector), count,
> bytesWritten, NIL) = 0)
> OR (bytesWritten < SectorSize) THEN
> res := WinApi.GetLastError();
> HALT(102)
> END;
> END PutSector;
>
> NOTE: Windows requires you to run programs that access raw storage devices
> in 'Administrator Mode'.
>
> Regards,
>
> Chris Burrows
> CFB Software
> Astrobe: Oberon for ARM Microcontrollers
> http://www.astrobe.com
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 10 Jan 2015 00:29:11 +0100
> From: J?rg Straube <joerg.straube at iaeth.ch>
> Subject: Re: [Oberon] Project Oberon - Copying files to the SD card
> To: "<chris at cfbsoftware.com>" <chris at cfbsoftware.com>, ETH Oberon and
> related systems <oberon at lists.inf.ethz.ch>
> Message-ID: <D56A1095-A20A-465E-A973-011166A8D69C at iaeth.ch>
> Content-Type: text/plain; charset=utf-8
>
> I have a prototype of this running under ETHOberon on Windows.
> Some hints:
> - My Oberon code finds the physical drive nbr itself by enumerating all
> drives and checking capabilities.
> - Being able to have lowlevel access to the SD card, I had to prevent
> Windows to access the SD card by unmounting the drive first.
> - As Chris wrote ETHOberon must be "run as admin".
> br, J?rg
>
> Am 09.01.2015 um 23:52 schrieb Chris Burrows <chris at cfbsoftware.com>:
>
> >>
> >> From: Bill Buzzell [mailto:captbill279 at gmail.com]
> >> Sent: Thursday, 8 January 2015 4:51 AM
> >> To: oberon at lists.inf.ethz.ch
> >> Subject: Re: [Oberon] Oberon Digest, Vol 128, Issue 6
> >>
> >> How do you move files onto the SD card? Anyone know? I tried
> >> extracting the ISO and adding files and un-extracting it again. None
> >> of the files appear visible to Oberon though. Am I using the wrong
> >> encoding somehow?
> >
> > If you want files on the SD card to be visible from Project Oberon then
> you need to create them with the appropriate file headers and directory
> entries as explained in great detail in Chapter 7 The File System of the
> Project Oberon documentation.
> >
> > You should write a program to do this on the system you want to transfer
> files from. As the Project Oberon source code is provided most of the hard
> work is already done for you. However, before you do this you need to
> understand:
> >
> > a) how to access the SD Card on your system
> > b) how to perform low-level block IO to / from a storage device on your
> system
> > c) the Project Oberon modules Files, FileDir and the disk IO procedures
> from Kernel.
> >
> > I used BlackBox Component Pascal v1.6 on Windows 7 as much of the
> Project Oberon source code (Files.mod and FileDir.mod) can be used with
> minimal changes, SYSTEM.VAL is compatible with Project Oberon and BlackBox
> has access to the relevent WinApi system calls:
> >
> > http://www.oberon.ch/blackbox.html
> >
> > If you plan to transfer files from a Windows 7 system to / from the SD
> Card the following should help get you started:
> >
> >
> > a) how to access the SD Card on your system
> >
> > If you cannot access the SD card via SPI on your system you need to find
> out how to access it as a raw (i.e. not formatted) device. On Windows the
> device name convention is \\.\<drivenumber>. On my system the drivenumber
> is "6" because my SD card appears as Drive 6 in:
> >
> > Admin Tools > Computer Management > Storage > Disk Management
> >
> > The 8GB Project Oberon SDHC Card appears with a 255MB FAT partition, a
> 64 MB Primary partition and 7.09GB unallocated
> >
> >
> > b) how to perform low-level block IO to / from a storage device on your
> system
> >
> > The corresponding BlackBox procedure to access this drive using
> WinApi.CreateFileW is:
> >
> > PROCEDURE Open*(driveName: FullName);
> > VAR
> > physicalName: FullName;
> > BEGIN
> > physicalName := "\\.\" + driveName;
> > drive.handle :=
> > WinApi.CreateFileW(
> > physicalName,
> > WinApi.GENERIC_READ + WinApi.GENERIC_WRITE,
> > WinApi.FILE_SHARE_READ + WinApi.FILE_SHARE_WRITE,
> > NIL,
> > WinApi.OPEN_EXISTING,
> > {},
> > 0)
> > END Open;
> >
> > You also need to implement the equivalent of the low-level sector read /
> write functions (i.e. Kernel.GetSector and Kernel.PutSector). On Windows
> the WinApi calls you can use to do this are
> >
> > WinApi.SetFilePointer
> > WinApi.ReadFile
> > WinApi.WriteFile
> > WinApi.GetLastError
> > WinApi.CloseHandle
> >
> > e.g PutSector becomes:
> >
> > PROCEDURE PutSector*(sectorNo: INTEGER; sector: ARRAY OF BYTE);
> > VAR
> > i, org, count, bytesWritten, res: INTEGER;
> > BEGIN
> > ASSERT(sectorNo MOD 29 = 0);
> > sectorNo := sectorNo DIV 29;
> > sectorNo := sectorNo * 2 + FSoffset;
> > org := sectorNo * (SectorSize DIV 2);
> > i := 0;
> > i := WinApi.SetFilePointer(drive.handle, org, i, WinApi.FILE_BEGIN);
> > count := SectorSize;
> > IF (WinApi.WriteFile(drive.handle, SYSTEM.ADR(sector), count,
> bytesWritten, NIL) = 0)
> > OR (bytesWritten < SectorSize) THEN
> > res := WinApi.GetLastError();
> > HALT(102)
> > END;
> > END PutSector;
> >
> > NOTE: Windows requires you to run programs that access raw storage
> devices in 'Administrator Mode'.
> >
> > Regards,
> >
> > Chris Burrows
> > CFB Software
> > Astrobe: Oberon for ARM Microcontrollers
> > http://www.astrobe.com
> >
> >
> >
> >
> > --
> > Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> > https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
>
>
> ------------------------------
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
>
> End of Oberon Digest, Vol 128, Issue 8
> **************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20150110/c6be6742/attachment.html
More information about the Oberon
mailing list