Skip to content

Commit

Permalink
Add NuttX Online Demo
Browse files Browse the repository at this point in the history
This PR adds the NuttX Online Demo based on [TinyEMU 64-bit RISC-V Emulator](https://github.com/fernandotcl/TinyEMU) and WebAssembly.

The [TinyEMU Port of NuttX](lupyuen2/wip-nuttx#54) shall be upstreamed later to NuttX Mainline. This will allow the Online Demo to be refreshed for new releases of NuttX. [More about NuttX for TinyEMU](https://lupyuen.github.io/articles/tinyemu)

Modified Files:

`index.md`: Add link to Demo Page: "Try the online demo here"

`_includes/themes/apache/default.html`: Add Demo CSS

New Files:

`demo.md`: New Demo Page with NuttX in TinyEMU Emulator

`demo/nuttx.bin`: NuttX Image compiled from the upcoming [TinyEMU Port of NuttX](lupyuen2/wip-nuttx#54) (64-bit RISC-V). Compiled with [these steps](https://github.com/lupyuen2/wip-pinephone-nuttx/releases/tag/tinyemu4-1) to produce these [Build Outputs](https://github.com/lupyuen2/wip-pinephone-nuttx/releases/tag/tinyemu4-1).

`demo/*.js, *.wasm, *.cfg, *.png`: Demo Files from [TinyEMU](https://github.com/fernandotcl/TinyEMU) project, based on [MIT Licence](https://github.com/fernandotcl/TinyEMU/blob/master/MIT-LICENSE.txt).

`assets/themes/apache/css/demo.css`: Demo CSS from [TinyEMU](https://github.com/fernandotcl/TinyEMU) project, based on [MIT Licence](https://github.com/fernandotcl/TinyEMU/blob/master/MIT-LICENSE.txt).

`_includes/themes/apache/demo.html`: New Theme for Demo Page

`_layouts/demo.html`: New Layout for Demo Page
  • Loading branch information
lupyuen authored and xiaoxiang781216 committed Jan 24, 2024
1 parent b5839ee commit 6948578
Show file tree
Hide file tree
Showing 16 changed files with 2,306 additions and 0 deletions.
1 change: 1 addition & 0 deletions _includes/themes/apache/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link href="{{ site.baseurl }}/assets/themes/apache/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="{{ site.baseurl }}/assets/themes/apache/css/style.css?body=1" rel="stylesheet" type="text/css">
<link href="{{ site.baseurl }}/assets/themes/apache/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
<link href="{{ site.baseurl }}/assets/themes/apache/css/demo.css" rel="stylesheet" type="text/css"/>
<!-- Le fav and touch icons -->
<!-- Update these with your own images
<link rel="shortcut icon" href="images/favicon.ico">
Expand Down
22 changes: 22 additions & 0 deletions _includes/themes/apache/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--<div class="hero-unit {{ page.title | lowercase }}">
<h1>{% if page.tagline %} <small>{{ page.tagline }}</small>{% endif %}</h1>
</div>
-->

<div class="row">
<div class="col-md-12">
{{ content }}

<div id="term_wrap">
<div id="term_container">
</div>
<div id="term_bar">
<progress id="net_progress">
</progress>
</div>
</div>

</div>
</div>
<script type="text/javascript" src="/demo/term.js"></script>
<script type="text/javascript" src="/demo/jslinux.js"></script>
5 changes: 5 additions & 0 deletions _layouts/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: default
---
{% include JB/setup %}
{% include themes/apache/demo.html %}
105 changes: 105 additions & 0 deletions assets/themes/apache/css/demo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#os_table {
border: 1px solid;
border-collapse: collapse;
margin: 20px;
}

#os_table td,#os_table th, #os_table tr {
border: 1px solid;
padding: 6px;
}

.os_comment {
font-size: 12px;
}

#copyright {
font-size: 10px;
}

/* for the terminal */
#term_wrap {
margin: 20px;
resize: both;
overflow: hidden;
}

.term {
font-family: monospace,courier,fixed,swiss,sans-serif;
font-weight: normal;
font-variant-ligatures: none;
color: #f0f0f0;
background: #000000;
line-height: normal;
overflow: hidden;
white-space: nowrap;
}

.term_content a {
color: inherit;
text-decoration: none;
}

.term_content a:hover {
color: inherit;
text-decoration: underline;
}

.term_cursor {
color: #000000;
background: #00ff00;
}

.term_char_size {
display: inline-block;
visibility: hidden;
position: absolute;
top: 0px;
left: -1000px;
padding: 0px;
}

.term_textarea {
position: absolute;
top: 0px;
left: 0px;
width: 0px;
height: 0px;
padding: 0px;
border: 0px;
margin: 0px;
opacity: 0;
resize: none;
}

.term_scrollbar { background: transparent url(/demo/images/bg-scrollbar-track-y.png) no-repeat 0 0; position: relative; background-position: 0 0; float: right; height: 100%; }
.term_track { background: transparent url(/demo/images/bg-scrollbar-trackend-y.png) no-repeat 0 100%; height: 100%; width:13px; position: relative; padding: 0 1px; }
.term_thumb { background: transparent url(/demo/images/bg-scrollbar-thumb-y.png) no-repeat 50% 100%; height: 20px; width: 25px; cursor: pointer; overflow: hidden; position: absolute; top: 0; left: -5px; }
.term_thumb .term_end { background: transparent url(/demo/images/bg-scrollbar-thumb-y.png) no-repeat 50% 0; overflow: hidden; height: 5px; width: 25px; }
.noSelect { user-select: none; -o-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; }

#keyboard-icon {
margin-left: 5px
margin-right: 5px;
}

/* file import */
#files {
visibility: hidden;
width:1px;
height:1px;
padding: 0px;
margin: 0px;
border: 0px;
}

label {
cursor: pointer;
margin-left: 5px;
margin-right: 5px;
}

#net_progress {
visibility: hidden;
width: 80px;
}
30 changes: 30 additions & 0 deletions demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: demo
title: Demo
tagline: Apache Project !
---

<!--
{% comment %}
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}
-->

{% include JB/setup %}

## NuttX Online Demo

Enter `help` to see the available commands.
Binary file added demo/images/bg-scrollbar-thumb-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/images/bg-scrollbar-track-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/images/bg-scrollbar-trackend-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/images/upload-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6948578

Please sign in to comment.