<div dir="ltr"><div>Hi Chris,</div><div>Great to hear from you.</div><div><br></div><div>>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:</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Any thoughts or concerns with this approach?</div><div><br></div><div>Best Regards,</div><div>Bill</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 6:00 AM, <span dir="ltr"><<a href="mailto:oberon-request@lists.inf.ethz.ch" target="_blank">oberon-request@lists.inf.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Oberon mailing list submissions to<br>
<a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:oberon-request@lists.inf.ethz.ch">oberon-request@lists.inf.ethz.ch</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:oberon-owner@lists.inf.ethz.ch">oberon-owner@lists.inf.ethz.ch</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Oberon digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Project Oberon - Copying files to the SD card (Chris Burrows)<br>
2. Re: Project Oberon - Copying files to the SD card (J?rg Straube)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 10 Jan 2015 09:22:36 +1030<br>
From: "Chris Burrows" <<a href="mailto:chris@cfbsoftware.com">chris@cfbsoftware.com</a>><br>
Subject: [Oberon] Project Oberon - Copying files to the SD card<br>
To: "ETH Oberon and related systems" <<a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a>><br>
Message-ID: <000f01d02c5e$f733cee0$e59b6ca0$@<a href="http://cfbsoftware.com" target="_blank">cfbsoftware.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
><br>
> From: Bill Buzzell [mailto:<a href="mailto:captbill279@gmail.com">captbill279@gmail.com</a>]<br>
> Sent: Thursday, 8 January 2015 4:51 AM<br>
> To: <a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a><br>
> Subject: Re: [Oberon] Oberon Digest, Vol 128, Issue 6<br>
><br>
> How do you move files onto the SD card? Anyone know? I tried<br>
> extracting the ISO and adding files and un-extracting it again. None<br>
> of the files appear visible to Oberon though. Am I using the wrong<br>
> encoding somehow?<br>
><br>
<br>
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.<br>
<br>
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:<br>
<br>
a) how to access the SD Card on your system<br>
b) how to perform low-level block IO to / from a storage device on your system<br>
c) the Project Oberon modules Files, FileDir and the disk IO procedures from Kernel.<br>
<br>
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:<br>
<br>
<a href="http://www.oberon.ch/blackbox.html" target="_blank">http://www.oberon.ch/blackbox.html</a><br>
<br>
If you plan to transfer files from a Windows 7 system to / from the SD Card the following should help get you started:<br>
<br>
<br>
a) how to access the SD Card on your system<br>
<br>
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:<br>
<br>
Admin Tools > Computer Management > Storage > Disk Management<br>
<br>
The 8GB Project Oberon SDHC Card appears with a 255MB FAT partition, a 64 MB Primary partition and 7.09GB unallocated<br>
<br>
<br>
b) how to perform low-level block IO to / from a storage device on your system<br>
<br>
The corresponding BlackBox procedure to access this drive using WinApi.CreateFileW is:<br>
<br>
PROCEDURE Open*(driveName: FullName);<br>
VAR<br>
physicalName: FullName;<br>
BEGIN<br>
physicalName := "\\.\" + driveName;<br>
drive.handle :=<br>
WinApi.CreateFileW(<br>
physicalName,<br>
WinApi.GENERIC_READ + WinApi.GENERIC_WRITE,<br>
WinApi.FILE_SHARE_READ + WinApi.FILE_SHARE_WRITE,<br>
NIL,<br>
WinApi.OPEN_EXISTING,<br>
{},<br>
0)<br>
END Open;<br>
<br>
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<br>
<br>
WinApi.SetFilePointer<br>
WinApi.ReadFile<br>
WinApi.WriteFile<br>
WinApi.GetLastError<br>
WinApi.CloseHandle<br>
<br>
e.g PutSector becomes:<br>
<br>
PROCEDURE PutSector*(sectorNo: INTEGER; sector: ARRAY OF BYTE);<br>
VAR<br>
i, org, count, bytesWritten, res: INTEGER;<br>
BEGIN<br>
ASSERT(sectorNo MOD 29 = 0);<br>
sectorNo := sectorNo DIV 29;<br>
sectorNo := sectorNo * 2 + FSoffset;<br>
org := sectorNo * (SectorSize DIV 2);<br>
i := 0;<br>
i := WinApi.SetFilePointer(drive.handle, org, i, WinApi.FILE_BEGIN);<br>
count := SectorSize;<br>
IF (WinApi.WriteFile(drive.handle, SYSTEM.ADR(sector), count, bytesWritten, NIL) = 0)<br>
OR (bytesWritten < SectorSize) THEN<br>
res := WinApi.GetLastError();<br>
HALT(102)<br>
END;<br>
END PutSector;<br>
<br>
NOTE: Windows requires you to run programs that access raw storage devices in 'Administrator Mode'.<br>
<br>
Regards,<br>
<br>
Chris Burrows<br>
CFB Software<br>
Astrobe: Oberon for ARM Microcontrollers<br>
<a href="http://www.astrobe.com" target="_blank">http://www.astrobe.com</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sat, 10 Jan 2015 00:29:11 +0100<br>
From: J?rg Straube <<a href="mailto:joerg.straube@iaeth.ch">joerg.straube@iaeth.ch</a>><br>
Subject: Re: [Oberon] Project Oberon - Copying files to the SD card<br>
To: "<<a href="mailto:chris@cfbsoftware.com">chris@cfbsoftware.com</a>>" <<a href="mailto:chris@cfbsoftware.com">chris@cfbsoftware.com</a>>, ETH Oberon and<br>
related systems <<a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a>><br>
Message-ID: <<a href="mailto:D56A1095-A20A-465E-A973-011166A8D69C@iaeth.ch">D56A1095-A20A-465E-A973-011166A8D69C@iaeth.ch</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
I have a prototype of this running under ETHOberon on Windows.<br>
Some hints:<br>
- My Oberon code finds the physical drive nbr itself by enumerating all drives and checking capabilities.<br>
- 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.<br>
- As Chris wrote ETHOberon must be "run as admin".<br>
br, J?rg<br>
<br>
Am 09.01.2015 um 23:52 schrieb Chris Burrows <<a href="mailto:chris@cfbsoftware.com">chris@cfbsoftware.com</a>>:<br>
<br>
>><br>
>> From: Bill Buzzell [mailto:<a href="mailto:captbill279@gmail.com">captbill279@gmail.com</a>]<br>
>> Sent: Thursday, 8 January 2015 4:51 AM<br>
>> To: <a href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a><br>
>> Subject: Re: [Oberon] Oberon Digest, Vol 128, Issue 6<br>
>><br>
>> How do you move files onto the SD card? Anyone know? I tried<br>
>> extracting the ISO and adding files and un-extracting it again. None<br>
>> of the files appear visible to Oberon though. Am I using the wrong<br>
>> encoding somehow?<br>
><br>
> 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.<br>
><br>
> 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:<br>
><br>
> a) how to access the SD Card on your system<br>
> b) how to perform low-level block IO to / from a storage device on your system<br>
> c) the Project Oberon modules Files, FileDir and the disk IO procedures from Kernel.<br>
><br>
> 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:<br>
><br>
> <a href="http://www.oberon.ch/blackbox.html" target="_blank">http://www.oberon.ch/blackbox.html</a><br>
><br>
> If you plan to transfer files from a Windows 7 system to / from the SD Card the following should help get you started:<br>
><br>
><br>
> a) how to access the SD Card on your system<br>
><br>
> 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:<br>
><br>
> Admin Tools > Computer Management > Storage > Disk Management<br>
><br>
> The 8GB Project Oberon SDHC Card appears with a 255MB FAT partition, a 64 MB Primary partition and 7.09GB unallocated<br>
><br>
><br>
> b) how to perform low-level block IO to / from a storage device on your system<br>
><br>
> The corresponding BlackBox procedure to access this drive using WinApi.CreateFileW is:<br>
><br>
> PROCEDURE Open*(driveName: FullName);<br>
> VAR<br>
> physicalName: FullName;<br>
> BEGIN<br>
> physicalName := "\\.\" + driveName;<br>
> drive.handle :=<br>
> WinApi.CreateFileW(<br>
> physicalName,<br>
> WinApi.GENERIC_READ + WinApi.GENERIC_WRITE,<br>
> WinApi.FILE_SHARE_READ + WinApi.FILE_SHARE_WRITE,<br>
> NIL,<br>
> WinApi.OPEN_EXISTING,<br>
> {},<br>
> 0)<br>
> END Open;<br>
><br>
> 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<br>
><br>
> WinApi.SetFilePointer<br>
> WinApi.ReadFile<br>
> WinApi.WriteFile<br>
> WinApi.GetLastError<br>
> WinApi.CloseHandle<br>
><br>
> e.g PutSector becomes:<br>
><br>
> PROCEDURE PutSector*(sectorNo: INTEGER; sector: ARRAY OF BYTE);<br>
> VAR<br>
> i, org, count, bytesWritten, res: INTEGER;<br>
> BEGIN<br>
> ASSERT(sectorNo MOD 29 = 0);<br>
> sectorNo := sectorNo DIV 29;<br>
> sectorNo := sectorNo * 2 + FSoffset;<br>
> org := sectorNo * (SectorSize DIV 2);<br>
> i := 0;<br>
> i := WinApi.SetFilePointer(drive.handle, org, i, WinApi.FILE_BEGIN);<br>
> count := SectorSize;<br>
> IF (WinApi.WriteFile(drive.handle, SYSTEM.ADR(sector), count, bytesWritten, NIL) = 0)<br>
> OR (bytesWritten < SectorSize) THEN<br>
> res := WinApi.GetLastError();<br>
> HALT(102)<br>
> END;<br>
> END PutSector;<br>
><br>
> NOTE: Windows requires you to run programs that access raw storage devices in 'Administrator Mode'.<br>
><br>
> Regards,<br>
><br>
> Chris Burrows<br>
> CFB Software<br>
> Astrobe: Oberon for ARM Microcontrollers<br>
> <a href="http://www.astrobe.com" target="_blank">http://www.astrobe.com</a><br>
><br>
><br>
><br>
><br>
> --<br>
> <a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br>
> <a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
<br>
<br>
<br>
------------------------------<br>
<br>
--<br>
<a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
<br>
<br>
End of Oberon Digest, Vol 128, Issue 8<br>
**************************************<br>
</blockquote></div><br></div>