Fill the screen with pixels x86 EGA Assembly

Having too much time ?

  1. Paste the code bellow in boot.asm;
  2. compile with nasm boot.asm -f bin -o boot.bin
  3. Prepare a fake floppy disk, dd if=/dev/zero of=floppy.img bs=512 count=2880
  4. Copy as boot.bin as boot sector on floppy: dd if=boot.bin of=floppy.img bs=512 count=1
  5. Boot a x86 virtual machine with floppy.img in A: (the first floppy drive)
  6. Profit

[bits 16]
[org 0x7c00]

jmp short begin
times 0x3B db 0

; Setup our Data Stack to 0
mov ax, 0x0000
mov ds, ax

; Setup our stack at 0x8000
mov bp, 0x8000
mov sp, bp

; Switch to graphics mode
mov ah, 0x00
mov al, 0x10
int 0x10

; Put a few pixels
mov ah, 0x0c ; Operation Write Pixel
mov al, 0xff ; Color
mov cx, 0x00 ; X
mov dx, 0x00 ; Y
mov bh, 0x00 ; Page

int 0x10 ; Call the BIOS !
cmp cx, 639 ; Compare cx to 639 (max X pixels)
je .hit_end_of_x ; If they're equal jump to .hit_end_of_x
add cx, 0x01 ; Add 1 to cx
jmp .put_pixel ; Jump back to .put_pixel

mov cx, 0x00 ; CX = 0
add dx, 0x01 ; Next line, DX = DX + 1
cmp dx, 349 ; Compare dx to 349 (max Y lines)
je .hit_end_of_y ; If they're equal jump to hit_end_of_y
jmp .put_pixel ; Jump back to .put_pixel

mov dx, 0x00 ; DX = 0
add al, 0x01 ; Next color (add 1 to al) [al = lower 8 bits of ah]
jmp .put_pixel ; Jump back to .put_pixel

; We should not reach here
hlt ; HALT (lower power)
jmp $ ; Jump here (infinite loop)

times 510-($-$$) db 0
dw 0xaa55

Writing new drivers for old OS

Writing new drivers for old OS

Trying to run old software on a new PC is quite a challenge; specs change, sometimes in incompatible ways and new technologies replace the old. Trying to run orcad386 isn’t without it’s challenges as you can read in this Yahoo Group dedicated to run Old Dos Orcad.

The thing that annoys me the most is the Mouse pointer integration in VirtualBox; clicking in my VM to move the mouse and pressing the “Host Key” to release it has cause me many issues. That and video (I did manage to get SVGA 1024×768@8bpp working!).

Which is why I opened up Visual Studio and the Windows 3.11 DDK… To write a mouse driver… If it goes well maybe I’ll take on the challenge of writing a video driver.

Installing Webex on 64 bits Linux (with sound)

This has only been tested on a vanilla Debian Sid. It was proven to work on 1 Ubuntu machine.

You’ll need a 32-bit Firefox, 32-bit JVM and dependencies. This guide will be command line only so that you can copy/paste. On a Debian remember that you don’t have sudo by default; you can either install and configure sudo or make sure you run commands as root.

If you have Skype running there’s a good chance you have everything and just need to jump the JVM part (as Skype is 32-bit only).

Continue reading

How unit tests reveal bad architecture

Unit tests are something awesome: they not only tell you if your changes will break everything but also when you need to mock out 10 dependencies you know something is wrong.

Having to mock out too many dependencies will make people less likely to write proper tests for it. Seems like writing tests is hard enough for your average developer so why make it harder ? I don’t have an upper limit on how much mocks are too much but when someone says “I don’t want to test this, I’ll have to mock half of the system”, that’s when you’ve gone over the limit. That’s when you should start splitting into sub-systems.

Something are better left to integration tests also; indeed I don’t think everything needs to be unit tested. At one point everything has to work.

My scope is dying

My scope is dying

Just after putting a circuit you want to test it. That’s when you power on your ‘scope. The last thing you want to see is a failure on the self-test…

At least I have one channel still working, I’ll try to debug the scope with that (and try not to kill myself with high-voltage)

Certified ScrumMaster

Certified ScrumMaster

Now that I am no longer a ScrumMaster at my work place, I’ve received my certificate that I’m a ScrumMaster. Awesome.

I do wonder why they feel the need to certify people. Does it guaranty something ? What would stop me from doing anything I want anyway ? What if I’m unable to see what I’m doing wrong ?

Bullshit Driven Development

Bullshit Driven Development is a style of development that forces you to think about the company politics before anything else. You need to build up an architecture that is so complex that other departments and so future-proof that other departments has no chance to attack it. Bonus points if you twist facts from the other departments in an evil way to thicken the architecture.

Back to top