TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: 1.5kb Microkernel for Ben Eater's 6502 Computer

230 pointsby jroesnerover 5 years ago

11 comments

Diederichover 5 years ago
I&#x27;m actually more excited to see a new Ben Eater video on youtube than anything else.<p>His stuff is just fantastic. Even though it&#x27;s lower level than I&#x27;ve ever worked, it&#x27;s extremely entertaining and educational.<p>His 6502 series is just great, but I want to highlight another couple of videos he did:<p>&quot;Let&#x27;s build a circuit that displays an image on a VGA monitor! In this video, I talk about how VGA signals work and build a circuit that provides the correct timing of sync signals so that a monitor recognizes the signal.&quot;<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=l7rce6IQDWs" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=l7rce6IQDWs</a>
评论 #22078687 未加载
评论 #22081295 未加载
kazinatorover 5 years ago
Skimming through this, this is the first piece of code that my eyes drilled into more deeply:<p><pre><code> LCD__clear_video_ram: pha ; preserve A via stack tya ; same for Y pha ldy #$20 ; set index to 32 .loop: lda #$20 ; set character to &#x27;space&#x27; sta VIDEO_RAM,Y ; clean video ram dey ; decrease index bne .loop ; are we done? no, repea sta VIDEO_RAM ; yes, write zero&#x27;th location manually pla ; restore Y tay pla ; restore A rts </code></pre> Surely we don&#x27;t need to keep loading the space character into A on every iteration?<p>Since Y starts at a hard-coded value that is (well) below $80, this could use &quot;bpl .loop&quot; and drop the &quot;sta VIDEO_RAM&quot; special case.<p>In .select_option, I&#x27;d looking into doing a jump table. Ideas here: <a href="https:&#x2F;&#x2F;wiki.nesdev.com&#x2F;w&#x2F;index.php&#x2F;Jump_table" rel="nofollow">https:&#x2F;&#x2F;wiki.nesdev.com&#x2F;w&#x2F;index.php&#x2F;Jump_table</a>
评论 #22078454 未加载
评论 #22084425 未加载
magicalhippoover 5 years ago
Semi-related, I&#x27;ve been enjoying Robert Baruch&#x27;s videos[1] on creating a FPGA implementation of the 6800, using nMigen and formal verification. First videos are almost like live coding, then he skips to a more compact format.<p>As a regular programmer, it&#x27;s quite interesting to get into how the bits actually end up getting the work done.<p>[1]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=85ZCTuekjGA&amp;list=PLEeZWGE3PwbbjxV7_XnPSR7ouLR2zjktw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=85ZCTuekjGA&amp;list=PLEeZWGE3Pw...</a>
Teknoman117over 5 years ago
Watching Ben Eater&#x27;s videos renewed my interest in making some simple computers out of old hardware, mainly because the older hardware is simple enough that you can work with it on a breadboard.<p>The interest eventually morphed into doing something with all of the old parts I&#x27;ve hoarded. Going through the bins of parts, I&#x27;ve found things like 8051 microcontrollers (P80C550) and UARTs (AM85C30) and some old RTC units (MC146818). I ended up picking up a few 68010&#x27;s (among other things) off of eBay with the hope of building a breadboard Linux computer, as slow as that may be. I believe the 68010 may be the <i>only</i> CPU in a DIP package still supported in some capacity by Linux (as long as you provide an MMU).<p>Hopefully this will actually get me back into writing&#x2F;making videos about my projects.
that_jojoover 5 years ago
I love, love, love Ben&#x27;s videos, and this is an awesome project.<p>But to be as painfully pedantic as possible: can we please use the word &#x27;monitor&#x27;, here? Calling it a &#x27;microkernel&#x27; really gives one the wrong initial impression.<p>Still, very neat. Now write a BASIC!
评论 #22081905 未加载
评论 #22079545 未加载
nategriover 5 years ago
Learning about multiple wonderful things at once here. This is pretty much catnip for 6502 fans.
danaurover 5 years ago
Are there any good resources for learning electronics for someone with a strong programming background and understand digital logic? Ben Eater videos assume knowledge of electronics and would like to know more
评论 #22079084 未加载
评论 #22081977 未加载
miohtamaover 5 years ago
This reminds me of C64 tape loaders or &quot;turboa&quot; that need to load the program to RAM.<p><a href="https:&#x2F;&#x2F;www.atarimagazines.com&#x2F;compute&#x2F;issue57&#x2F;turbotape.html" rel="nofollow">https:&#x2F;&#x2F;www.atarimagazines.com&#x2F;compute&#x2F;issue57&#x2F;turbotape.htm...</a><p>Also let&#x27;s not forget Bill Gates&#x27;s 17 bytes loader<p><a href="https:&#x2F;&#x2F;hackaday.com&#x2F;2017&#x2F;03&#x2F;24&#x2F;doing-it-with-fewer-bytes-than-bill-gates&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hackaday.com&#x2F;2017&#x2F;03&#x2F;24&#x2F;doing-it-with-fewer-bytes-th...</a>
评论 #22082209 未加载
kevstevover 5 years ago
Nice! my 6502 kit arrived today! And there is snow in the forecast this weekend- Really looking forward to building this.
评论 #22081709 未加载
jcmeyrignacover 5 years ago
I just read your source code a bit, and there are a lot of things wrong. First, you should ALWAYS clear the carry when using ADC or set the carry when using SBC<p>For example: .increase: adc #1 sta POSITION_MENU<p>I have no idea if you increment or add two, since the carry is not cleared.<p><pre><code> clc lda CURRENT_RAM_ADDRESS_L adc #$01 sta CURRENT_RAM_ADDRESS_L lda CURRENT_RAM_ADDRESS_H adc #$00 sta CURRENT_RAM_ADDRESS_H </code></pre> this is done by the usual INC CURRENT_RAM_ADDRESS_L BNE *+2 INC CURRENT_RAM_ADDRESS_H<p><pre><code> ldy POSITION_CURSOR cpy #0 </code></pre> cpy #0 is useless.<p>lda POSITION_CURSOR cmp #0 cmp #0 is useless<p>jsr &#x2F; rts can be replaced by jmp<p>clear_ram is super slow
评论 #22085411 未加载
atum47over 5 years ago
great job.