Author Topic: Help needed programming my 86Duino board  (Read 201 times)

jejump

  • Regular Member
  • *
  • Posts: 11
    • JEJmp Machine Automation
Help needed programming my 86Duino board
« on: November 06, 2018, 02:27:50 AM »

Hello fellow Masm Programmers!

Hope this post finds everyone doing well today.  I come seeking information regarding PCI Configuration Register space (I think).  A little backstory here... 


I purchased a Vortex86EX SoC chip based tiny computer called the 86Duino.  Hopefully I didn't just send most of you running away on that statement. This device seems to be aimed at the Arduino community as the target audience.  I've never really been interested in Arduino and its cumbersome libraries.  Putting aside this thing's Arduino-ness, what I see here is that this device seems to be a fully functioning PC on a chip (most everything except video, which I've added on) and I currently have a DOS image running on it.  From what I am reading, accessing the device's GPIO port is only achieved after you establish the Base Address Register for the GPIO somehow in the PCI Configuration Register space.  For the life of me, I can't get my head around what all this entails.  Vortex/DMP tech support has never bothered with replying to my emails.  The processor's datasheets are either not elementary enough for someone who's never played around with PCI configuration space or just not all that well written in general.  All of the code examples I can find online (and I've searched pretty exhaustively) are all C based and I have a hard time following it to reverse engineer it.  My problem I believe, is that much critical information exist in header files that I can't seem to access. 

There is one included Arduino example I compiled that creates a DOS executable that strobes an onboard LED and reports to the screen just how many times the LED has ON/OFF cycled.  If I were to write that same program in assembly language or in DOS DEBUG environment and using say, the INT 21 service 09 to display the message, that would result in a binary executable about 100 bytes or less.  The executable this example created for this simple task was just under 700KB!  Absolutely ridiculous!!  So, I came here to see if any experience PCI driver writers can help me make sense of all of this.  I'll be glad to upload screenshots or page snippets from the datasheet if that helps or whatever is needed.


Thank you all in advance!!

Kind Regards,
John

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5897
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Help needed programming my 86Duino board
« Reply #1 on: November 06, 2018, 02:42:02 AM »
John,

If you can set up an old x86 box to write the code on and have some method of transferring it to the Vortex chip, you should be able to use any of the old x86 real mode assemblers with it. TASM MASM and others that I forget as it was too long ago. See if you have access to the old DOS system file, dos and bios tsrs and you should be able to do whatever you like with it. I don't ever remember seeing PCI bus information being available so I am not much use to you here.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jejump

  • Regular Member
  • *
  • Posts: 11
    • JEJmp Machine Automation
Re: Help needed programming my 86Duino board
« Reply #2 on: November 06, 2018, 03:06:47 AM »
Thanks for the reply, Hutch!  I should also add here that the GPIO addresses are unique to this board and apparently, the I/O address is dynamic (hence, the need to understand PCI configuration).  If I may reference another post's forum:


Hi,
 The GPIO's base addresses need to be configured on EX (mean those addresses are not fixed). If not configure them, GPIO function is disable. A simple method to configure them as below for reference 86Duino source code:

1. access SouthBridge(SB) and set GPIO base address at 62h, 63h. For 86Duino, it is set as 0xF100 in standard I/O space. You can set another as you like (recommend to set a high address). Access SB method for refer to ftp://ftp.dmp.com.tw/DMP_Vorte.....091216.pdf.
 2. access address 0xF100 (standard I/O space), set GPIO enable bit (0xF100h ~ 0xF103h).
 3. set 0xF104 ~ 0xF107 for GPIO0's DIR base address and DATA base address, 0xF108 ~ 0xF10B for GPIO1's DIR base address and DATA base address and so on. For 86Duino, GPIO0's DIR address is set as 0xF202 and DATA address is 0xF200, GPIO1's DIR address is set as 0xF206 and DATA address is 0xF204 and so on.
 4. access 0xF200 and 0xF202, you can use GPIO0, access 0xF204 and 0xF206 to use GPIO1 and so on.

In addition, to output GPIO signal, need to configure CORSSBAR as below:

1. set CROSSBAR base address at SB 0x64, 0x65. For 86Duino, it is set as 0x0A00 (standard I/O space).
 2. start to access CROSSBAR function from address 0x0A00.
 For reference, https://gist.github.com/nonakap/9045101.
 (posted from http://www.86duino.com/?page_i.....on-educake)

Regards


The whole convo is right here:
http://www.86duino.com/?page_id=85/programming-questions/io-register



This is straight from the forum of the 86Duino community.  Apparently I'm not the only one wanting to avoid the Arduino nonsense and program in a more straightforward approach.

Jj

FORTRANS

  • Member
  • *****
  • Posts: 1033
Re: Help needed programming my 86Duino board
« Reply #3 on: November 06, 2018, 07:54:35 AM »
Hi,

   Sounds like a fun project.  What kind of video did you hook
up?  Just using Google leaves me a bit confused about the
86Durino, any helpful links?

   There is a Usenet group alt.os,development that might be
a good place to ask about PCI configuration.

Regards,

Steve N.

jejump

  • Regular Member
  • *
  • Posts: 11
    • JEJmp Machine Automation
Re: Help needed programming my 86Duino board
« Reply #4 on: November 06, 2018, 08:41:50 AM »
I appreciate the website tip, Steve! 

So the 86Duino has a miniature PCI slot on its backside and mine currently has the optional VGA card installed in it.  It is entirely possible to operate this without a video card at all.  My board came with a USB cable and you can download terminal software for your PC and execute DOS commands.  There is a line in the AUTOEXEC.BAT file you'll need to REM out in the event you want to use the VGA card like me and not the remote terminal. I like the idea of this little x86 board.  However, support from Vortex has been a bit of a disappointment.  I successfully created an 86Duino account when I bought my two boards and today for the first time ever, I can post there also.  Every time in the past when I would try to create a new thread, I'd get "page Error 403" on the site.  Maybe between the 86Duino community and Masm32, I can get some things happening!   :biggrin:

 John

Edit:  Forgot to include the link to the products page.  On this page you will find the Mini PCIe VGA card that I'm using.

http://www.86duino.com/?page_id=11


AW

  • Member
  • *****
  • Posts: 1562
  • Let's Make ASM Great Again!
Re: Help needed programming my 86Duino board
« Reply #5 on: November 08, 2018, 08:32:29 AM »
Have you tried to look at the source code, most notably this part https://github.com/roboard/86Duino/tree/master/hardware/86duino/x86 ?
I am just asking because that guy in the forum is not prescient, he got such massive, albeit confusing, knowledge somewhere.

jejump

  • Regular Member
  • *
  • Posts: 11
    • JEJmp Machine Automation
Re: Help needed programming my 86Duino board
« Reply #6 on: November 08, 2018, 08:50:03 AM »
Thanks for the link, AW.  I don't think I've ever stumbled upon this in my searches.  I'll dig into this and see what it has to tell me!  :icon14: