Posts

Showing posts with the label gnu

Towards GNU/MINIX - Bootloader

Image
  GNU/MINIX = GNU Tools with MINIX kernel Repackage MINIX 3.3 kernel to boot with GRUB 2.06 MINIX CD has three partitions - boot, ramdisk image and usr filesystem image. It uses NetBSD bootloader and userland tools. $ sudo sfdisk -l minix.iso  Disk minix.iso: 577.53 MiB, 605581312 bytes, 1182776 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device     Boot Start     End Sectors   Size Id Type minix.iso1          0   12287   12288     6M 81 Minix / old Linux minix.iso2      12288   82087   69800  34.1M 81 Minix / old Linux minix.iso3      82088 1182775 1100688 537.4M 81 Minix / old Linux   Extract files required for...

PCB Design in GNU Emacs

Image
Gerber For fun, here's a Gerber file generated from SVG footprints drawn in GNU Emacs . Note: gerbv displays polygon pad incorrectly as circle in fast mode . You should use use normal mode for this. Or else use gerbview . 3D Model If you have properly modeled footprints (1:1 scale, XY plane of the 3D model on the PCB and origin at the center of the bounding box), then you can easily generate 3D view of the assembly. In this screenshot, you can see the generated model being rendered by view3dscene. The code expects eda:url attribute to point to the 3D model (.wrl file for VRML 2.0). The shape with eda:type="board" is used as the PCB. (require 'gerber) (setq canvas-plugin-map pcb-canvas-map) Fancy fonts on Silkscreen Do you want fancy fonts on your PCB silkscreen? You can use a Hershey font or stroke font in SVG format to achieve the desired result. A small collection of these fonts are available at https://gitlab.com/oskay/svg-fonts . Code: https://gitlab.com/at...

SPICE simulation in GNU Emacs (From schematics)

Image
Now you can design and run SPICE simulation for simple circuits in GNU Emacs. Since the circuit and graphs are in SVG format, you can easily annotate and share it on the web or embed it in a document.   Video tutorial for configuring the circuit diagram, running the simulation and plotting the results is below:  Video tutorial for drawing the circuit diagram using widgets is below:   Code:   https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/spice-mode.el   Setup: Setup is covered in following blog posts. https://lifeofpenguin.blogspot.com/2021/10/svg-widget-in-gnu-emacs.html https://lifeofpenguin.blogspot.com/2021/10/spice-simulation-in-gnu-emacs.html Additionally, we need to make special spice plugin (defined in spice-mode.el) available to canvas-mode. This makes plugin keybindings available via C-x in canvas-mode. To do this, add following to .emacs (setq canvas-plugin-map spice-canvas-map)  ...

SVG widget in GNU Emacs

Image
  (Top) SVG sprite sheet (Bottom) widgets from sprite sheet (Left) SVG widget in Emacs buffer Now you can use SVG widget in GNU Emacs. That is, use an SVG image or fragment as background for push-button widget in Emacs buffer. You can also specify the width and height of the widget for finer control. Generally speaking, you can use any type of image for this purpose. But SVG suits best because you can draw widget of any size without any distortion.   The ability to use SVG fragment means you can define multiple symbols in an SVG and use the same as a sprite sheet or a symbol library for your UI requirements. Thus the number of files to be managed is reduced. An SVG symbol library is a simple SVG file with each symbol as a direct descendant of the root node. Video above shows an example of such usage. Another use case would be better looking customize form. Or at the very least, rounded "Save" and "Cancel" buttons. In other words, a more visually appealing UI in grap...

SPICE simulation in GNU Emacs

Image
Now you can manage and run SPICE simulation within GNU Emacs using ngspice. To visualize the output, the code uses ngspice control card to run gnuplot.   .emacs ;; Check the location of spice-mode.el (load "~/spice-mode.el") (setq spice-simulator "Ngspice"       spice-waveform-viewer "ngplot") ;; ngplot is a new custom viewer defined in elisp which uses gnuplot   Install ngspice and gnuplot # apt install ngspice gnuplot Download https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/spice-mode.el . Load the file (load "~/spice-mode.el") Open a new buffer and activate mode using M-x spice-mode . Select simulator Ngspice and waveform viewer ngplot via menu or by setting variables (same as in .emacs above). Enter circuit definition. Run the simulation using C-c C-r (spice-compile). Go to error, if any, using 'next-error' ( M-x next-error or M-g n ). Plot the results using C-c C-v (spice-plot). Enter the fields (e.g. int out) to be plotted. S...