Building a Basic Operating System - IO from Scratch - Part 11

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии •

  • @weirdboyjim
    @weirdboyjim  Месяц назад +2

    Join us on Discord: discord.gg/jmf6M3z7XS
    Follow me on Twitter: twitter.com/WeirdBoyJim
    Support the channel on Patreon: www.patreon.com/JamesSharman

  • @OscarSommerbo
    @OscarSommerbo 4 дня назад +13

    Twas the night before Christmas and Mr Sharman dropped a new video!

    • @weirdboyjim
      @weirdboyjim  4 дня назад +3

      Hope it didn’t disappoint!

  • @miege90
    @miege90 3 дня назад +3

    Absolutely amazing. Feels like the only thing left now is to build/connect an EEPROM programmer, so you can start building a homebrew CPU, using the JAM-1 to program it 😂

  • @thisnthat3530
    @thisnthat3530 3 дня назад +2

    For an EXE format I think the Atari 8 bit method is quite simple and elegent.
    The exe file is made of 1 or more segments, each segment starts with a 2 byte magic number (0xffff) then has a 2 byte start address and a 2 byte end address followed by the data itself. after loading all segments, the address 0x02e0 is checked by the OS to determine if it has been populated during the load, and if it has then a jump to the address stored there is executed.
    It allows for such things as loading a splash screen directly into video memory, loading values into harware registers to bank switch RAM, etc, etc, all before the program is executed from an arbitrary address.

  • @AiOinc1
    @AiOinc1 Месяц назад +10

    Glad you were able to use my video here, I had intended to go dig up my 486 and make it do the directory on an 800MB Conner drive, but I wasn't able to actually physically find it before you needed the clip.

  • @jerril42
    @jerril42 Месяц назад +4

    Thanks James. Fabulous. So cool to see JAM-1 with an OS. It has come together very nicely. Take care.

    • @weirdboyjim
      @weirdboyjim  Месяц назад +5

      Glad you enjoyed it! Getting some pressure to add a keyboard to make it stand alone now.

  • @edgeeffect
    @edgeeffect Месяц назад +5

    Yeah... it really really is like a "proper computer" now. I love how you new command line BOTH deals with files AND still has all the disassembly and dump stuff in the same interface. Exactly what I really really wanted back in the 8-bit days.

    • @weirdboyjim
      @weirdboyjim  Месяц назад +3

      Thanks! Need to write a few more utilities, be nice to have a text editor!

    • @edgeeffect
      @edgeeffect Месяц назад

      @@weirdboyjim Oh yes... very nice!

    • @JanBruunAndersen
      @JanBruunAndersen 4 дня назад +1

      Joe is a nice little editor.

  • @Otakutaru
    @Otakutaru 4 дня назад +2

    YES YES YES! I'm always blown away by the amount of work taht has gone into the project int order to be able to do this kind of things

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Glad you are enjoying the project!

  • @m1geo
    @m1geo 14 дней назад +28

    3:07 - you say "dir" is a command, yet I'm the muppet who types "ls" into DOS.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +5

      It always take me a few minutes to re-adapt when switching between a unix shell and dos!

    • @PleegWat
      @PleegWat 4 дня назад +3

      I used to have that problem too, and then I started using powershell where `dir` and `ls` are both aliases to `List-ChildItem`.

    • @BrainSlugs83
      @BrainSlugs83 4 дня назад

      ​@@PleegWatthis!

    • @sparthir
      @sparthir 3 дня назад +2

      I end up making a ls.bat file so I don't need to think about it. 😁

  • @your_utube
    @your_utube 2 дня назад

    Always fascinating to watch. Now all that is needed is a compiler, or am I jumping the gun here?
    In any case, I want to wish you a very blessed Christmas James, and thanks for making Christmas day so much more interesting with your video and may the project blaze on into 2025.
    Now, If you can excuse me, I am going to the kitchen to see about helping the wife with prep for our Christmas feast!!!

  • @iamdarkyoshi
    @iamdarkyoshi 4 дня назад +1

    Dude this project is so cool, you deserve soooo many more views

  • @DaedalusRaistlin
    @DaedalusRaistlin 4 дня назад +1

    That's an awesome milestone! Your custom PC has fascinated me for ages, it's great to see it's software capabilities take a nice big stride. I wonder if I could port the C4 compiler/interpreter/thingy to your architecture, then you'd have a C compiler (I've written a whole toolset for that already, including a multitasking kernel. Just have to update the compiler to output the native assembly.)
    How hard would it be to make a multitasking kernel I wonder...do you have an interrupt for the RTC, or something else that could be used for pre-emptive multitasking? It may not be too difficult...
    Still, a lot of the fun is doing all that yourself.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Someone on discord already has a C compiler up and running, I don’t know much about the C4 toolchain

  • @olavl8827
    @olavl8827 3 дня назад +1

    Fantastic work as usual! Clever to tame the monitor's memory usage by putting its functionality in external programs.
    I know everyone wants to see a C compiler and/or a BASIC interpreter for this computer. But how about CHIP-8 as well? Your computer seems well capable of running a CHIP-8 virtual machine and there are many programs and games already written that you could then run.

  • @Dustycircuit
    @Dustycircuit 4 дня назад +1

    This is such a great educational project. I love it!

  • @frognik79
    @frognik79 3 дня назад +2

    DOS shell + mouse would be nice.
    Give those gfx a work out.

  • @bkuker
    @bkuker 4 дня назад +5

    You could have saved a couple bytes using the right names like "ls" and "cat" ;)
    The rom vs disk monitor at the end reminds me of the Apple days, where you might boot into ROM basic instead of ProDOS by mistake, spend hours writing a program, and then realize you can not save it because you have no operating system.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      The bytes might be handy one day! But they are file names so I wouldn’t actually be saving anything.

    • @bkuker
      @bkuker 4 дня назад +2

      @@weirdboyjim I realized that, but figured I'd leave my dos v unix swipe up anyway. I do think the spirit of this machine is more early pc than early unix, so you chose right. Awesome progress as always!

  • @skmgeek
    @skmgeek 3 дня назад

    This is an amazing birthday present! Thank you so so much for making these videos, they always make my day!

  • @KludgesFromKevinsCave
    @KludgesFromKevinsCave 4 дня назад

    Lovely! You really capture the flavour of the period.
    I'm mildly surprised that you didn't add some sort of bank switching, so you could put a lot of the kernel/OS functions into shadow memory and leave more for apps.
    I once built a Frankenstein monster of a CP/M system that had half a megabyte of memory, with the bottom 32k (except for page 0) swappable. I had a text editor (based on Mince - Mince Is Not Complete Emacs) and a compile-link-go system (based on BDS C) that both had their code partitioned into overlays. They'd have their bank switcher up in the space occupied by the CP/M CCP. 256k of the memory could be configured as a RAM drive or a disk cache. That system got me through my MSEE!

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      It wouldn’t be that tough to make a bank switcher, but that is usually just a retrofit so I’md rather build a new system with a larger native address bus in the future!

  • @porklaser
    @porklaser 4 дня назад +1

    I think this is my favorite video so far. It very well illustrates how powerful and useful an operating system can be. All of those building blocks , code, tools, utilities all brought together under one interface. No longer any need to modify the entire source to change or add one function, simply compile and update the modular executable and drop it on the SD card. Love how the old demos/code came along too!

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Hopefully I’ll be able to get all the old demos up and running as executable files.

  • @wallyhall
    @wallyhall Месяц назад +2

    This is so brilliant. (!). As you say, it feels like a “real computer” more and more - and I think that is demonstrated by the fact you’re “progressing faster” (if that makes sense).
    Do you intend to implement anything analogous to software interrupts?

    • @weirdboyjim
      @weirdboyjim  Месяц назад +3

      Glad you liked it! Do you mean interrupts like the "int xx" instruction that x86 machines use to communicate with system routines? No plans for that (although I could create a "int" macro for accessing the jump table) I do want a cleaner route to this for Jam-2 though.

    • @wallyhall
      @wallyhall Месяц назад +1

      @ yeah, something analogous to the int instruction. I’ll look forward to seeing what Jam-2 brings!

  • @helmutzollner5496
    @helmutzollner5496 4 дня назад

    James, it is truely amazing how for you have taken this project now. Well done.
    I am wondering how much futher you will drive the hardware in the future.
    Really stunning how responsive the system is running, even without interrupts.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Glad you are finding it interesting, just finished a new graphical demo I know you’ll like when it releases!

    • @helmutzollner5496
      @helmutzollner5496 4 дня назад

      @weirdboyjim 😆

  • @ruevs
    @ruevs 2 дня назад

    "Jam 1" would soon be ready enough for "Tiny Tapeout". I wonder how many tiles it would fit in.

  • @pipsqueak2009
    @pipsqueak2009 День назад

    That’s fantastic progress!

  • @johnwilson3918
    @johnwilson3918 3 дня назад

    James! I've been 'away' for some time... I come back and you have an OS! I'd love to see a C Compiler. I'm about to start one for my (more humble) microprocessor - using the text from Frazer and Hanson. Have a good Christmas!

  • @KitsuneAlex
    @KitsuneAlex 3 дня назад

    The only gift i need for christmas! Great video as always

  • @m1geo
    @m1geo 14 дней назад

    Really enjoyed this one James! One of my favourite episodes!

  • @twobob
    @twobob 3 дня назад

    Best project, got even better. Merry holimass James.

  • @adamclark1928
    @adamclark1928 4 дня назад

    James, this is impressive and it looks to be fast approaching the finish line. How much is really left with this project? I am interest to see your next project will be.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Circuitry is just some extra modules on the vga circuit. Should be getting to them soon. Writing games and demos will take some time but that will overlap with some groundwork on new stuff.

  • @YadraVoat
    @YadraVoat 3 дня назад

    You have so precisely the same accent as Thunderf00t, such that I was very confused what happened to his face, and hair color! 😁

  • @damianvila
    @damianvila 4 дня назад

    Fantastic James! Congrats. Somebody mentioned BASIC, and I was thinking that MS BASIC source code is actually available on Github, so probably no need to create an implementation from zero, if you wanted that (though I understand not wanting to have BASIC, it’s so impractical nowadays. Just something us old timers like 😆)

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      I might take a look at that some time, no idea how plausible a port would be.

  • @kepanoid
    @kepanoid 4 дня назад

    Thank you for this Christmas present, including all the colourful lights!
    What happens when you run a program that doesn't end naturally? How would you go about stopping it without a total reset? As in: ctrl-c, how?

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      I have a bit of common code that exits on a keystroke, but if I make a mistake I have reach for the reset button!

  • @talideon
    @talideon 4 дня назад

    Nice work! While the commands might not be quite complex enough to justify it yet, do you have any plans to introduce an autoexec.bat equivalent and/or aliases? I can see things like aliases being useful for commands like "write" so you can hide addresses behind a friendly name, and it shouldn't cost too much memory if the alias names are encoded in a trie.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      Something like a batch file may not be that tough, I’d need a text editor on the system first or it wouldn’t be very useful.

  • @alabamacajun7791
    @alabamacajun7791 4 дня назад

    Having an OS is a major jump, congrats. Maybe Electric Rabbit and Snak Jams games will hit store shelves soon 😜 Just looking at the overall system footprint is amazing for how small it is. Impressed!

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      Thanks! Glad you are enjoying it!

  • @bradywb98
    @bradywb98 Месяц назад

    Hm, I noticed that when your BIOS routine was called by `hellorld`, it did so via a jump, not a call. The jump table also just jumps instead of calling. I might be missing something really obvious, but how is execution returned to the resident program?
    Also, I think it’s extremely impressive how quick something like `cd` or `dir` executes given that they’re being loaded from disk each time. I suppose they’re not very big, but there’s a fair bit of file system code to retrieve the executable.

    • @weirdboyjim
      @weirdboyjim  Месяц назад +2

      I wondered if someone would ask about. This is called a “Tail call”, when a function call is the last thing you want to do in a function you use jump rather than call, then the child functions ret instruction return to the parent functions caller. Saves a few bytes and cycles.

    • @bradywb98
      @bradywb98 Месяц назад

      Ah of course! I don’t think I’ve ever seen an assembly example of a tail call, so that’s pretty neat.

  • @bzuidgeest
    @bzuidgeest 3 дня назад

    If I understood correctly you put the os in ROM. Why not put it in ram? Or is that too small? I cannot remember how much ram your computer has to play with. You could have a very small monitor load the os from SD, basically you would almost never have to update the monitor eeprom again.

  • @DavidLatham-productiondave
    @DavidLatham-productiondave 4 дня назад

    Excellent! It's such a relief to be free of the ROM.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      It’s been on a continuous trajectory of needing fewer rom contents changes for a while!

    • @DavidLatham-productiondave
      @DavidLatham-productiondave 4 дня назад

      @weirdboyjim does boot.bin completely replace the ROM monitor? In other words do you swap the ROM for ram? If so you can eek out more speed with ram generally being faster than ROM.

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      @ the rom already gets shadowed, so the whole of memory is ram by the time code is running.

  • @SieIaQ
    @SieIaQ 4 дня назад

    Very impressive work. You should make a book about all your beautiful work, that could survive doomsday.
    So one day humans could start from scratch based on "Von Sharman" architecture ;)
    Btw. Did you consider more Unix like OS or μClinux ? or this is next step ?
    Merry X-mas !

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      The “OS” will not get very advanced on this hardware, future builds where I have some more ram will have need of more.

  • @khatharrmalkavian3306
    @khatharrmalkavian3306 23 дня назад +2

    Will the GUI be called WindowJAM?

    • @weirdboyjim
      @weirdboyjim  19 дней назад +3

      I think GUI may have to wait for a future system. 😅

    • @roostertechchan
      @roostertechchan 3 дня назад +1

      It's a quite funny coincidence but in Turkish the word for window is 'cam', which is pronounces as 'Jam' 😁

    • @ruevs
      @ruevs 2 дня назад

      @@roostertechchan and in Bulgarian window is "прозорец" (prozoretz), but "Jam" is slang for window borrowed from Turkish. The correct transliteration of the word - as we use it in Bulgarian would be "dzham".
      " WindowDzham" wold be a rather obscure name, with a reference understandable to few, for the hypothetical future windowing system of the hypothetical future computer :-)

    • @roostertechchan
      @roostertechchan 2 дня назад

      I know, but I thought the reference is too far fetched 🤷‍♂️

  • @sim82
    @sim82 4 дня назад

    Seems to be a common theme... in my own 6502 'OS-ish monitor thingie' the 'help' and 'ls' commands currently just print out 'sorry, you're on your own...' 😬

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      So I was above the curve having actual help all this time?

    • @sim82
      @sim82 2 дня назад

      @@weirdboyjim definitely! Your CPU build was the main reason for me to start into my current 6502 adventure.

  • @glennallan7561
    @glennallan7561 4 дня назад

    Wow! Than you. You are an inspiration!

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      Glad to hear you are enjoying it!

  • @bobfish7699
    @bobfish7699 4 дня назад

    Awsome James. Working on BASIC yet?

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      Not done anything yet, would be nice to have something higher level.

  • @Schwuuuuup
    @Schwuuuuup Месяц назад

    For the folks following in your steps or that are otherwise inspired by it, are there things that looking back you would have done in a different way? Is it maybe a short talk (for the second channel)?

    • @weirdboyjim
      @weirdboyjim  Месяц назад +1

      I did a video a while back called "Design retrospective" ruclips.net/video/QZMcBETdydA/видео.html which covered some stuff. I may do a similar video when it's fully done that covers the whole system.

  • @peter.stimpel
    @peter.stimpel Месяц назад

    Nice. Things are coming together. Do you have any plans to open this can of worms called Codepages and Regional Settings? Not that I find it useful, but the engineers of that time were facing such challenges, and so I ask myself if James want to face them as well.

    • @weirdboyjim
      @weirdboyjim  Месяц назад

      Not something I’ve thought about. When I’m outputting to a terminal that works with utf8 I get natural support for basic Unicode anyway.

    • @peter.stimpel
      @peter.stimpel Месяц назад

      That is the "boring" way - LOL. I was hoping for some broken encoding one day, you know. As it was in the old days ... Sorry for such forbidden thoughts

    • @KludgesFromKevinsCave
      @KludgesFromKevinsCave 4 дня назад

      @@weirdboyjim Wise decision. Mojibake were the plague of my existence for quite a while.

  • @kingnick6260
    @kingnick6260 4 дня назад

    The RUclips algo sent me here after searching for Nvidia Infiniband switches. It knows me too well!

  • @ffsireallydontcare
    @ffsireallydontcare 4 дня назад

    It would be great if you could provide access to your public resources outside of Discord. Some of us *cannot* use Discord.

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      What restrictions are you under? I’m trying to avoid multiplying up the number of things I have to keep track of.

    • @ffsireallydontcare
      @ffsireallydontcare 4 дня назад

      @@weirdboyjim Feel like moving off RUclips too? The RUclips censorship bot's bottom lip started quivering ... Let's try again...
      Discord banned my account before I even finished the signup process. Seriously. The home screen hadn't even finished loading. Official Discord client, no funny business. Trust and Safety eventually unlocked it with an "oops our bad", only to ban it again 2 weeks later for no reason.
      32 days after filing the appeal T&S finally responded with a "we can't find your account", because locked accounts are automatically deleted after 30 days. Now my mobile number cannot be used for another signup, and a mobile is *required*.
      It saddens me that so many interesting and open source projects are locking their communities away behind such a rubbish proprietary system that can't be archived for future reference by open systems.

    • @luz_reyes_676
      @luz_reyes_676 3 дня назад

      @@weirdboyjim maybe you could put your stuff on ben eater's website. if discord isnt enough. not saying its a good idea. just the first idea i thought of.

  • @younessamr6802
    @younessamr6802 2 дня назад

    the most important part of an OS is syscalls

  • @JyrkiKoivisto
    @JyrkiKoivisto 4 дня назад

    Kind of Amiga OS like library jumptable

    • @talideon
      @talideon 4 дня назад

      What popped into my head, given the naming scheme, was RISC OS's SWI interface.

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      Jump tables like this are pretty common if the cpu doesn’t have something handy like software interupts.

  • @djsmeguk
    @djsmeguk 4 дня назад

    Very nice indeed. Next up, BASIC interpreter? 😂

    • @weirdboyjim
      @weirdboyjim  4 дня назад +1

      It would indeed be interesting to get something high level going.

  • @AJB2K3
    @AJB2K3 4 дня назад

    Nice!

  • @matthewpeterson5159
    @matthewpeterson5159 4 дня назад

    relocatable files when? :P

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      The way my Isa handles pointers that could be tricky!

  • @JanBruunAndersen
    @JanBruunAndersen 4 дня назад

    Next up: A port of Tiny C.

    • @weirdboyjim
      @weirdboyjim  4 дня назад

      Someone on discord already has a ‘c’ compiler up and running!

  • @TomStorey96
    @TomStorey96 Месяц назад +1

    Very impressive! This would surely make this feel much more like a standalone computer and less of an embedded platform.
    I have a long term goal on my list to make my own OS of sorts using the FreeRTOS kernel, so it would end up being a (probably pre-emptive) multitasking OS, with executables compiled as ELF binaries, and have capabilities like TSRs and loadable device drivers (I guess they are very much the same thing in a way).
    I still have a few things to learn and figure out before then though, like how to make a binary that can be loaded anywhere in memory and still run, but this serves as great inspiration towards such a thing! Thanks 🙂

    • @weirdboyjim
      @weirdboyjim  Месяц назад +1

      Sounds like a good project. Relocatable code always used to be accomplished by have an executable file section that lists all the pointers for load time relocation.

    • @TomStorey96
      @TomStorey96 Месяц назад

      @weirdboyjim yep. I've been playing around with .exe's recently, writing C in Turbo C, compiling it, and extracting the executable code to make a ROM image to run on my 286 board.
      That just has a table of segments and offsets that you need to add a value to. I assume ELF would be similar to a degree, but I haven't looked too much into it yet.

  • @-lolus-
    @-lolus- 4 дня назад

    the best thing is that it is better than windows, maybe i cant watch YT, but at least it does not spy on me XD

    • @benhetland576
      @benhetland576 4 дня назад

      Making that thing able to display YT videos would actually be an interesting future project! It's amazing what this thing can do already.

    • @-lolus-
      @-lolus- 4 дня назад

      @@benhetland576 i mean, 144p @1 FPM maybe, but it also has to litle memory for things like that. but man can dream

    • @weirdboyjim
      @weirdboyjim  4 дня назад +2

      No spyware in the wild for Jam-1 yet!