Re: pc386 BSP documentation tweaks.

2020-09-21 Thread Joel Sherrill
On Mon, Sep 21, 2020 at 12:40 PM Karel Gardas 
wrote:

> On 9/21/20 7:34 PM, Gedare Bloom wrote:
> > On Sat, Sep 19, 2020 at 2:31 PM Karel Gardas 
> wrote:
> >>
> >>
> >> Hello,
> >>
> >> attached are three patches:
> >>
> >> pc386 BSP: add runtime options for debugging and move few lines
> >> around for better context.
> >> pc386 BSP: add a note about default baud rate for console over
> UART/COM.
> >> pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the option is long
> >> time gone.
> >
> > We still have this option, but I don't think it does anything. Maybe
> > it should be noted as "Obsolete"?
>
> By "long gone" I mean this option is handled by configure/make and now
> also waf, but is not preserved in the C code at all. So basically the
> option does nothing as implementation C code was probably removed.
>
> Or am I looking wrong?
>

No. It is dead as in "He's dead, Jim". :)

It is still in the README:

pc386/README:+ BSP_ENABLE_COM1_COM4 - value of 1 to enable, 0 to disable
pc386/README:+ BSP_USE_COM1_AS_CONSOLE - value of 1 forces console to COM1
pc386/README:  USE_COM1_AS_CONSOLE=1 --enable-rtemsbsp=pc386 \

And I think providing guidance in the user's manual that if you used to
use this option when building, that there is a new way to achieve the same
result would be desirable.

--joel

>
> Thanks,
> Karel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: pc386 BSP documentation tweaks.

2020-09-21 Thread Karel Gardas
On 9/21/20 7:52 PM, Gedare Bloom wrote:
>> By "long gone" I mean this option is handled by configure/make and now
>> also waf, but is not preserved in the C code at all. So basically the
>> option does nothing as implementation C code was probably removed.
>>
>> Or am I looking wrong?
>>
> 
> I think you're correct. I'm just wondering if it is better to note
> that this option exists but doesn't do anything, as opposed to just
> removing its documentation.

I've not managed this over my weekend RTEMS hobby but my idea was to
submit doc change first and then also submit source code change which
would remove configuration bits of the option completely -- result would
be RTEMS clean of the option completely.

Sorry about missing source code removal yet.

Karel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: pc386 BSP documentation tweaks.

2020-09-21 Thread Gedare Bloom
On Mon, Sep 21, 2020 at 11:40 AM Karel Gardas  wrote:
>
> On 9/21/20 7:34 PM, Gedare Bloom wrote:
> > On Sat, Sep 19, 2020 at 2:31 PM Karel Gardas  
> > wrote:
> >>
> >>
> >> Hello,
> >>
> >> attached are three patches:
> >>
> >> pc386 BSP: add runtime options for debugging and move few lines
> >> around for better context.
> >> pc386 BSP: add a note about default baud rate for console over 
> >> UART/COM.
> >> pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the option is long
> >> time gone.
> >
> > We still have this option, but I don't think it does anything. Maybe
> > it should be noted as "Obsolete"?
>
> By "long gone" I mean this option is handled by configure/make and now
> also waf, but is not preserved in the C code at all. So basically the
> option does nothing as implementation C code was probably removed.
>
> Or am I looking wrong?
>

I think you're correct. I'm just wondering if it is better to note
that this option exists but doesn't do anything, as opposed to just
removing its documentation.

> Thanks,
> Karel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: pc386 BSP documentation tweaks.

2020-09-21 Thread Karel Gardas
On 9/21/20 7:34 PM, Gedare Bloom wrote:
> On Sat, Sep 19, 2020 at 2:31 PM Karel Gardas  wrote:
>>
>>
>> Hello,
>>
>> attached are three patches:
>>
>> pc386 BSP: add runtime options for debugging and move few lines
>> around for better context.
>> pc386 BSP: add a note about default baud rate for console over UART/COM.
>> pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the option is long
>> time gone.
> 
> We still have this option, but I don't think it does anything. Maybe
> it should be noted as "Obsolete"?

By "long gone" I mean this option is handled by configure/make and now
also waf, but is not preserved in the C code at all. So basically the
option does nothing as implementation C code was probably removed.

Or am I looking wrong?

Thanks,
Karel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: pc386 BSP documentation tweaks.

2020-09-21 Thread Gedare Bloom
On Sat, Sep 19, 2020 at 2:31 PM Karel Gardas  wrote:
>
>
> Hello,
>
> attached are three patches:
>
> pc386 BSP: add runtime options for debugging and move few lines
> around for better context.
> pc386 BSP: add a note about default baud rate for console over UART/COM.
> pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the option is long
> time gone.

We still have this option, but I don't think it does anything. Maybe
it should be noted as "Obsolete"?

>
> please review/commit or request change(s).
>
> The patches are based on my playing with BSP and seeing documentation
> limitations or missing info bits...
>
> Thanks,
> Karel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


pc386 BSP documentation tweaks.

2020-09-19 Thread Karel Gardas

Hello,

attached are three patches:

pc386 BSP: add runtime options for debugging and move few lines
around for better context.
pc386 BSP: add a note about default baud rate for console over UART/COM.
pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the option is long
time gone.

please review/commit or request change(s).

The patches are based on my playing with BSP and seeing documentation
limitations or missing info bits...

Thanks,
Karel
>From a75c0231f2252d6980dbfb7c9c0b8870efffc53b Mon Sep 17 00:00:00 2001
From: Karel Gardas 
Date: Sat, 19 Sep 2020 20:12:45 +
Subject: [PATCH 3/3] pc386 BSP: add runtime options for debugging and move few
 lines around for better context.

---
 user/bsps/bsps-i386.rst | 32 +++-
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/user/bsps/bsps-i386.rst b/user/bsps/bsps-i386.rst
index 7addd25..8556ec2 100644
--- a/user/bsps/bsps-i386.rst
+++ b/user/bsps/bsps-i386.rst
@@ -137,6 +137,9 @@ inside the Qemu emulator.
 	specifies target device for printk/getk
 	calls. E.g. ``--printk=/dev/vgacons``
 
+If the specified console device is not present then suitable fallback
+device is selected based on the device order specified in `Console Drivers`.
+
 .. option:: --video=
 
 	specifies required video mode. The options applies only to
@@ -154,12 +157,27 @@ inside the Qemu emulator.
 
 	disables usage of COM1 thorough COM4.
 
-If the specified console device is not present then suitable fallback
-device is selected based on the device order specified in `Console Drivers`.
+.. option:: --gdb=
 
-PCI-based UART devices are named ``/dev/pcicom`` as they are
-probed and found. The numbers sequence starts with 1. E.g. first PCI
-UART device found is accessible with ``/dev/pcicom1`` name.
+specifies UART device for communication between BSP's
+GDB stub and GDB running on a host system. Option accepts device
+and baud rate like the ``--console`` option above.
+E.g. ``--gdb=/dev/com2,115200`` instructs BSP to use COM2 device
+for GDB stub/host communication with the speed of 115200 bauds.
+
+.. note:: default GDB stub/host communication speed and other
+  communication properties are same like for console over
+  UART. E.g. 9600 baud rate, 8 data bits, no parity
+  and 1 stop bit.
+
+.. option:: --gdb-break
+
+halts BSP execution at a break point in the BSP initialization code
+and waits for GDB connection.
+
+.. option:: --gdb-remote-debug
+
+outputs the GDB remote protocol data to printk.
 
 Testing with Qemu
 -
@@ -318,6 +336,10 @@ following order of priority:
 - COM1 thorough COM4
 - Any COM devices on the PCI bus including IO and memory mapped
 
+PCI-based UART devices are named ``/dev/pcicom`` as they are
+probed and found. The numbers sequence starts with 1. E.g. first PCI
+UART device found is accessible with ``/dev/pcicom1`` name.
+
 Besides supporting generic devices above, the BSP also support
 specific UART chips. The drivers for those are not initialized
 automatically, but requires initialization from the application code:
-- 
2.25.1

>From c49ddaeff77416619c3a2d2fd08c383d75ba12e0 Mon Sep 17 00:00:00 2001
From: Karel Gardas 
Date: Sat, 19 Sep 2020 19:23:03 +
Subject: [PATCH 2/3] pc386 BSP: add a note about default baud rate for console
 over UART/COM.

---
 user/bsps/bsps-i386.rst | 4 
 1 file changed, 4 insertions(+)

diff --git a/user/bsps/bsps-i386.rst b/user/bsps/bsps-i386.rst
index ea3b990..7addd25 100644
--- a/user/bsps/bsps-i386.rst
+++ b/user/bsps/bsps-i386.rst
@@ -128,6 +128,10 @@ inside the Qemu emulator.
 	device. E.g. ``--console=/dev/com1``. COM device name may
 	also be followed by a baud rate like ``--console=/dev/com2,19200``
 
+.. note:: pc386 BSP family is using 9600 as a default baud rate
+  for console over UART (/dev/comX). It is also using
+  8 data bits, no parity and 1 stop bit.
+
 .. option:: --printk=
 
 	specifies target device for printk/getk
-- 
2.25.1

>From aebad3094f608a92b37cfdf1f367210cb19dba6a Mon Sep 17 00:00:00 2001
From: Karel Gardas 
Date: Sat, 19 Sep 2020 19:10:19 +
Subject: [PATCH 1/3] pc386 BSP: remove USE_COM1_AS_CONSOLE reference, the
 option is long time gone.

---
 user/bsps/bsps-i386.rst | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/user/bsps/bsps-i386.rst b/user/bsps/bsps-i386.rst
index 3080d69..ea3b990 100644
--- a/user/bsps/bsps-i386.rst
+++ b/user/bsps/bsps-i386.rst
@@ -64,9 +64,6 @@ Build Configuration Options
 ``BSP_ENABLE_COM1_COM4``
   Enables support of COM1 thorough COM4 (enabled by default).
 
-``USE_COM1_AS_CONSOLE``
-  Enforces usage of COM1 as a console device (disabled by default).
-
 ``BSP_ENABLE_IDE``
   Enables legacy IDE driver (enabled by default).
 
-- 
2.25.1

___

Re: pc386 BSP documentation.

2020-09-08 Thread Chris Johns
On 8/9/20 12:51 pm, Chris Johns wrote:
> On 8/9/20 5:57 am, Karel Gardas wrote:
>>
>> attached is a patch adding some pc386 BSP documentation.
>>
>> Review, comments, suggestions and/or commit of it are/is highly appreciated.
>>
> 
> This is a really good and welcome contribution so thank you.
> 
> I will commit it with a few minor changes in a day or so after others have had
> time to review it.

Pushed. Thanks

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: pc386 BSP documentation.

2020-09-07 Thread Chris Johns
On 8/9/20 5:57 am, Karel Gardas wrote:
> 
> attached is a patch adding some pc386 BSP documentation.
> 
> Review, comments, suggestions and/or commit of it are/is highly appreciated.
> 

This is a really good and welcome contribution so thank you.

I will commit it with a few minor changes in a day or so after others have had
time to review it.

Thanks
Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


pc386 BSP documentation.

2020-09-07 Thread Karel Gardas

Hi,

attached is a patch adding some pc386 BSP documentation.

Review, comments, suggestions and/or commit of it are/is highly appreciated.

Thanks,
Karel
>From 44e7ab4da6435fbf334eae5d6e68c6eb9847421c Mon Sep 17 00:00:00 2001
From: Karel Gardas 
Date: Tue, 25 Aug 2020 10:28:19 +
Subject: [PATCH] user/pc386 BSP: add documentation.

The content is compiled from TBR pc386 wiki page, BSP's README files
and from the actual BSP code.
---
 user/bsps/bsps-i386.rst | 396 +++-
 1 file changed, 395 insertions(+), 1 deletion(-)

diff --git a/user/bsps/bsps-i386.rst b/user/bsps/bsps-i386.rst
index a29edf6..5d48853 100644
--- a/user/bsps/bsps-i386.rst
+++ b/user/bsps/bsps-i386.rst
@@ -8,4 +8,398 @@ i386
 pc386
 =
 
-TODO.
+This BSP supports a standard Intel/AMD PC on i386 and up CPUs. If run
+on a Pentium or above, the TSC register is used for timing calibration
+purposes rather than relying entirely on the i8254.
+Partial support is implemented for more modern PCs which do not have a
+complete complement of legacy peripherals.
+
+The BSP is able to utilize up to 3 GB of available RAM and up to 16
+CPUs. Hyper-threading is supported, but may not be detected by the
+BSP successfully.
+
+.. note:: BSP capability to detect target hardware SMP details is
+	  limited due to fact the SMP support is implemented based on
+	  Intel Multi-Processor Specification (MPS). Final version of
+	  the specification is version 1.4 which was released on July
+	  1, 1995. On most newer machines the MPS functionality was
+	  more or less supplanted by more modern ACPI (Advanced
+	  Configuration and Power Interface). Still, on some machine
+	  SMP support may be fragile at least at the platform
+	  detection and initialization state depending on the target
+	  BIOS/ACPI/MPS compatibility implementation.
+
+There are several BSP variants provided which differ only in the target CPU
+optimization. The most general is `pc386` which is tuned for i386. The `pc486`
+variant is tuned for i486, `pc585` is tuned for Pentium, `pc586-sse` is tuned
+for Pentium processor supporting SSE instructions. Finally `pc686` is tuned
+for Pentium Pro processor, but generating only instructions for Pentium
+and `pcp4` is tuned and generating instructions for Pentium4 processor
+including SSE3 instructions.
+
+
+Build Configuration Options
+---
+
+``BSP_PRESS_KEY_FOR_RESET``
+  If defined to a non-zero value, then print a message and wait until
+  any key is pressed before resetting board when application
+  terminates (disabled by default).
+
+``BSP_RESET_BOARD_AT_EXIT``
+  If defined to a non-zero value, then reset the board when the
+  application terminates (enabled by default).
+
+``BSP_PRINT_EXCEPTION_CONTEXT``
+  If defined to a non-zero value, then print the exception context
+  when an unexpected exception occurs (enabled by default).
+
+``BSP_VERBOSE_FATAL_EXTENSION``
+  If defined to a non-zero value, then print more information in case
+  of a fatal error (enabled by default).
+
+``BSP_ENABLE_VGA``
+  Enables VGA console driver (enabled by default).
+
+``BSP_ENABLE_COM1_COM4``
+  Enables support of COM1 thorough COM4 (enabled by default).
+
+``USE_COM1_AS_CONSOLE``
+  Enforces usage of COM1 as a console device (disabled by default).
+
+``BSP_ENABLE_IDE``
+  Enables legacy IDE driver (enabled by default).
+
+``IDE_USE_PRIMARY_INTERFACE``
+  Allows RTEMS to use storage drive(s) connected to the primary IDE
+  interface. Disable if (i) the target hardware does not have primary
+  IDE interface or (ii) it does not have any drive attached to the
+  primary IDE interface or (iii) there is no need to use drive(s)
+  attached to the primary IDE interface at all (enabled by default).
+
+``IDE_USE_SECONDARY_INTERFACE``
+  Allows RTEMS to use storage drive(s) connected to the secondary IDE
+  interface. Enable if (i) the target hardware does have secondary IDE
+  interface and (ii) there is at least one drive attached to the
+  secondary IDE interface and (iii) there is a need to use drive(s)
+  attached to the secondary IDE interface (disabled by default).
+
+``BSP_VIDEO_80x50``
+  Sets the VGA display to 80x50 character mode (disabled by default).
+
+``CLOCK_DRIVER_USE_TSC``
+  Enforces clock driver to use TSC register available on Pentium and
+  higher class CPUs. If disabled and ``CLOCK_DRIVER_USE_8243`` is
+  disabled too, then BSP will choose clock driver mechanism itself
+  during the runtime (disabled by default).
+
+``CLOCK_DRIVER_USE_8254``
+  Enforces clock driver to use 8254 chip. If disabled and
+  ``CLOCK_DRIVER_USE_TSC`` is disabled too, then BSP will choose clock
+  driver mechanism itself during the runtime (disabled by default).
+
+``NUM_APP_DRV_GDT_DESCRIPTORS``
+  Defines how many descriptors in GDT may be allocated for the
+  application or driver usage.
+
+``USE_CIRRUS_GD5446``
+  Enables usage of Cirrus GD5446 graphic card for RTEMS frame-buffer
+  (disabled by

WP: pc386 BSP documentation.

2020-08-28 Thread Karel Gardas

Hi,

attached is current work in progress of my pc386 BSP documentation attempt.

There is still a big "Running on PC hardware" paragraph missing, but
other parts should be more stable hence good for review and/or comments.

Thanks,
Karel

>From 952311867654322c75f8b0fa47e0f11786876831 Mon Sep 17 00:00:00 2001
From: Karel Gardas 
Date: Tue, 25 Aug 2020 10:28:19 +
Subject: [PATCH] user/pc386 BSP: add some documentation (booting on real PC HW
 info still missing)

---
 user/bsps/bsps-i386.rst | 294 +++-
 1 file changed, 293 insertions(+), 1 deletion(-)

diff --git a/user/bsps/bsps-i386.rst b/user/bsps/bsps-i386.rst
index a29edf6..8b00e18 100644
--- a/user/bsps/bsps-i386.rst
+++ b/user/bsps/bsps-i386.rst
@@ -8,4 +8,296 @@ i386
 pc386
 =
 
-TODO.
+This BSP supports a standard Intel/AMD PC on i386 and up CPUs. If run
+on a Pentium or above, the TSC register is used for timing calibration
+purposes rather than relying entirely on the i8254.
+Partial support is implemented for more modern PCs which do not have a
+complete complement of legacy peripherals.
+
+The BSP is able to utilize up to 3 GB of available RAM and up to 16
+CPUs. Hyper-threading is not supported, but BSP will run on system
+with hyper-threading enabled just reporting number of cores as a
+number of available CPUs.
+
+There are several BSP variants provided which differ only in the target CPU
+optimization. The most general is `pc386` which is tuned for i386. The `pc486`
+variant is tuned for i486, `pc585` is tuned for Pentium, `pc586-sse` is tuned
+for Pentium processor supporting SSE instructions. Finally `pc686` is tuned
+for Pentium Pro processor, but generating only instructions for Pentium
+and `pcp4` is tuned and generating instructions for Pentium4 processor
+including SSE3 instructions.
+
+
+Build Configuration Options
+---
+
+``BSP_PRESS_KEY_FOR_RESET``
+  If defined to a non-zero value, then print a message and wait until
+  any key is pressed before resetting board when application
+  terminates (disabled by default).
+
+``BSP_RESET_BOARD_AT_EXIT``
+  If defined to a non-zero value, then reset the board when the
+  application terminates (enabled by default).
+
+``BSP_PRINT_EXCEPTION_CONTEXT``
+  If defined to a non-zero value, then print the exception context
+  when an unexpected exception occurs (enabled by default).
+
+``BSP_VERBOSE_FATAL_EXTENSION``
+  If defined to a non-zero value, then print more information in case
+  of a fatal error (enabled by default).
+
+``BSP_ENABLE_VGA``
+  Enables VGA console driver (enabled by default).
+
+``BSP_ENABLE_COM1_COM4``
+  Enables support of COM1 thorough COM4 (enabled by default).
+
+``USE_COM1_AS_CONSOLE``
+  Enforces usage of COM1 as a console device (disabled by default).
+
+``BSP_ENABLE_IDE``
+  Enables legacy IDE driver (enabled by default).
+
+``IDE_USE_PRIMARY_INTERFACE``
+  Allows RTEMS to use storage drive(s) connected to the primary IDE
+  interface. Disable if (i) the target hardware does not have primary
+  IDE interface or (ii) it does not have any drive attached to the
+  primary IDE interface or (iii) there is no need to use drive(s)
+  attached to the primary IDE interface at all (enabled by default).
+
+``IDE_USE_SECONDARY_INTERFACE``
+  Allows RTEMS to use storage drive(s) connected to the secondary IDE
+  interface. Enable if (i) the target hardware does have secondary IDE
+  interface and (ii) there is at least one drive attached to the
+  secondary IDE interface and (iii) there is a need to use drive(s)
+  attached to the secondary IDE interface (disabled by default).
+
+``BSP_VIDEO_80x50``
+  Sets the VGA display to 80x50 character mode (disabled by default).
+
+``CLOCK_DRIVER_USE_TSC``
+  Enforces clock driver to use TSC register available on Pentium and
+  higher class CPUs. If disabled and ``CLOCK_DRIVER_USE_8243`` is
+  disabled too, then BSP will choose clock driver mechanism itself
+  during the runtime (disabled by default).
+
+``CLOCK_DRIVER_USE_8254``
+  Enforces clock driver to use 8254 chip. If disabled and
+  ``CLOCK_DRIVER_USE_TSC`` is disabled too, then BSP will choose clock
+  driver mechanism itself during the runtime (disabled by default).
+
+``NUM_APP_DRV_GDT_DESCRIPTORS``
+  Defines how many descriptors in GDT may be allocated for the
+  application or driver usage.
+
+``USE_CIRRUS_GD5446``
+  Enables usage of Cirrus GD5446 graphic card for RTEMS frame-buffer
+  (disabled by default).
+
+``USE_VGA``
+  Enables usage of generic VGA graphic card for RTEMS frame-buffer
+  (disabled by default).
+
+``USE_VBE_RM``
+  Enables usage of graphic card implementing VESA BIOS Extensions for
+  RTEMS frame-buffer (enabled by default).
+
+``BSP_GDB_STUB``
+  Enables GDB support for debugging over serial port (enabled by
+  default).
+
+Runtime Options
+---
+The BSP supports several runtime options. They may be used by either setting
+during boot by using target hardwa