From ffjeld at common-lisp.net Sat Jun 7 13:00:09 2008 From: ffjeld at common-lisp.net (ffjeld) Date: Sat, 7 Jun 2008 09:00:09 -0400 (EDT) Subject: [movitz-cvs] CVS movitz/ide Message-ID: <20080607130009.5662B742C3@common-lisp.net> Update of /project/movitz/cvsroot/movitz/ide In directory clnet:/tmp/cvs-serv19205 Modified Files: movitz-slime.el Log Message: Patch from Yoni Rabkin. --- /project/movitz/cvsroot/movitz/ide/movitz-slime.el 2007/06/23 13:40:02 1.7 +++ /project/movitz/cvsroot/movitz/ide/movitz-slime.el 2008/06/07 13:00:08 1.8 @@ -61,7 +61,7 @@ (defcustom movitz-mode-image-file nil "*Movitz image file. -This is set by `movitz-dump-image' and can also be preinitialized in +This is set by `movitz-dump' and can also be preinitialized in your init file." :type 'string :group 'movitz) @@ -172,43 +172,24 @@ (lambda (result) (message "Movitz args for %s: %s." string result)))))) - - - -(defun movitz-dump-image (filename) - "Dump the current image to FILENAME." - (interactive (list (if (and (null current-prefix-arg) - movitz-mode-image-file) - movitz-mode-image-file - (let ((filename (read-file-name "Image file: "))) - (setq movitz-mode-image-file filename) - filename)))) - (message "Dumping..") - (slime-eval-async `(movitz.ide:dump-image ,filename) - (lambda (_) (message "Finished.")))) - - -(defun movitz-dump-image-and-qemu (filename) - "Dump the current image to FILENAME." - (interactive (list (if (and (null current-prefix-arg) - movitz-mode-image-file) - movitz-mode-image-file - (let ((filename (expand-file-name (read-file-name "Image file: ")))) - (setq movitz-mode-image-file filename) - filename)))) - (lexical-let ((filename filename)) - (message "Dumping '%s'.." filename) - (slime-eval-async `(movitz.ide:dump-image ,(file-name-nondirectory filename)) - (lambda (_) - (message "Dumping '%s'..done, starting qemu" filename) - (call-process movitz-mode-qemu-binary-path - nil 0 nil - "-s" - "-L" movitz-mode-qemu-directory - "-fda" filename - "-boot" "a"))))) - - +(defun movitz-dump (&optional run-emulator) + "Dump the current image to a file. +If RUN-EMULATOR is non-nil, call an emulator on the resulting file." + (when (not movitz-mode-image-file) + (setq movitz-mode-image-file (expand-file-name (read-file-name "Image file: ")))) + (message "Dumping '%s'.." movitz-mode-image-file) + (slime-eval-async `(movitz.ide:dump-image ,(file-name-nondirectory movitz-mode-image-file)) + (if run-emulator + ;; choose emulator here, currently only qemu + (lambda (_) + (message "Dumping '%s'..done, starting qemu" movitz-mode-image-file) + (call-process movitz-mode-qemu-binary-path + nil 0 nil + "-s" + "-L" movitz-mode-qemu-directory + "-fda" movitz-mode-image-file + "-boot" "a")) + (lambda (_) (message "Dumping '%s'..done" movitz-mode-image-file))))) (defun movitz-defun-name-and-type () (interactive) @@ -268,8 +249,8 @@ (defconst movitz-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map text-mode-map) - (define-key map (kbd "C-c d") 'movitz-dump-image) - (define-key map (kbd "C-c C-d") 'movitz-dump-image-and-qemu) + (define-key map (kbd "C-c d") '(lambda () (interactive) (movitz-dump))) + (define-key map (kbd "C-c C-d") '(lambda () (interactive) (movitz-dump t))) (define-key map (kbd "C-c C-v") 'movitz-disassemble-defun) (define-key map (kbd "C-c m") 'movitz-macroexpand) (define-key map (kbd "C-c a") 'movitz-arglist) From ffjeld at common-lisp.net Thu Jun 12 12:54:52 2008 From: ffjeld at common-lisp.net (ffjeld) Date: Thu, 12 Jun 2008 08:54:52 -0400 (EDT) Subject: [movitz-cvs] CVS movitz/losp/lib/net Message-ID: <20080612125452.D74AB4904E@common-lisp.net> Update of /project/movitz/cvsroot/movitz/losp/lib/net In directory clnet:/tmp/cvs-serv20648 Modified Files: ethernet.lisp Log Message: Fix missing keyword args in format-ethernet-packet. --- /project/movitz/cvsroot/movitz/losp/lib/net/ethernet.lisp 2005/08/31 22:35:10 1.11 +++ /project/movitz/cvsroot/movitz/losp/lib/net/ethernet.lisp 2008/06/12 12:54:52 1.12 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld ;;;; Created at: Tue Sep 17 15:25:31 2002 ;;;; -;;;; $Id: ethernet.lisp,v 1.11 2005/08/31 22:35:10 ffjeld Exp $ +;;;; $Id: ethernet.lisp,v 1.12 2008/06/12 12:54:52 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------ @@ -166,8 +166,8 @@ (defun format-ethernet-packet (packet source destination type &key (start 0) (source-start 0) (destination-start 0)) - (setf (ether-source packet start source-start) source - (ether-destination packet start destination-start) destination + (setf (ether-source packet start :source-start source-start) source + (ether-destination packet start :destination-start destination-start) destination (ether-type packet start) type) packet) From aantoniadis at common-lisp.net Fri Jun 13 16:21:18 2008 From: aantoniadis at common-lisp.net (aantoniadis) Date: Fri, 13 Jun 2008 12:21:18 -0400 (EDT) Subject: [movitz-cvs] CVS movitz/losp/lib/net Message-ID: <20080613162118.92E875001E@common-lisp.net> Update of /project/movitz/cvsroot/movitz/losp/lib/net In directory clnet:/tmp/cvs-serv32554 Modified Files: arp.lisp Log Message: Added init-device, now test-arp can find a device --- /project/movitz/cvsroot/movitz/losp/lib/net/arp.lisp 2005/06/05 01:08:21 1.10 +++ /project/movitz/cvsroot/movitz/losp/lib/net/arp.lisp 2008/06/13 16:21:18 1.11 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld ;;;; Created at: Thu Mar 20 15:01:15 2003 ;;;; -;;;; $Id: arp.lisp,v 1.10 2005/06/05 01:08:21 ffjeld Exp $ +;;;; $Id: arp.lisp,v 1.11 2008/06/13 16:21:18 aantoniadis Exp $ ;;;; ;;;;------------------------------------------------------------------ @@ -97,22 +97,33 @@ (mac-address nic) muerte.ethernet:+broadcast-address+ muerte.ethernet:+ether-type-arp+))))) - -(defun test-arp (&optional (ip #(129 242 16 30)) (my-ip #(129 242 16 173)) - (device *ne2000*)) + + +(defun device-init () + (let ((ethernet + (some #'muerte.x86-pc.ne2k:ne2k-probe + muerte.x86-pc.ne2k:*ne2k-probe-addresses*))) + (assert ethernet ethernet "No ethernet device.") + ethernet)) + + +(defun test-arp (&optional (ip #(192 168 178 1)) (my-ip #(147 52 192 157)) + (device (device-init))) (loop with ip = (ip4-address ip) and my-ip = (ip4-address my-ip) for packet = (muerte.ethernet:receive device) - with i = 9999 - do (when (= (incf i) 10000) - (setf i 0) - (transmit device - (format-ethernet-packet (format-arp-request nil +arp-op-request+ - my-ip (mac-address device) ip) - (mac-address device) - muerte.ethernet:+broadcast-address+ - muerte.ethernet:+ether-type-arp+))) + with i = 9999 ;;this way we go into the do in the first iteration + do + (when (= (incf i) 10000) + (setf i 0) + (transmit device + (format-ethernet-packet (format-arp-request nil +arp-op-request+ + my-ip (mac-address device) ip) + (mac-address device) + muerte.ethernet:+broadcast-address+ + muerte.ethernet:+ether-type-arp+))) until (or (muerte.x86-pc.keyboard:poll-char) + ; (format t "~a~%" packet) ;;mine (when (and packet (or (eq +ether-type-arp+ (ether-type packet)) (warn "not type")) From aantoniadis at common-lisp.net Fri Jun 13 16:25:31 2008 From: aantoniadis at common-lisp.net (aantoniadis) Date: Fri, 13 Jun 2008 12:25:31 -0400 (EDT) Subject: [movitz-cvs] CVS movitz/losp/lib/net Message-ID: <20080613162531.BDB7350AC@common-lisp.net> Update of /project/movitz/cvsroot/movitz/losp/lib/net In directory clnet:/tmp/cvs-serv585 Modified Files: ip6.lisp Log Message: minor fixes --- /project/movitz/cvsroot/movitz/losp/lib/net/ip6.lisp 2004/11/24 16:21:42 1.7 +++ /project/movitz/cvsroot/movitz/losp/lib/net/ip6.lisp 2008/06/13 16:25:31 1.8 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld ;;;; Created at: Wed Nov 14 17:25:31 2001 ;;;; -;;;; $Id: ip6.lisp,v 1.7 2004/11/24 16:21:42 ffjeld Exp $ +;;;; $Id: ip6.lisp,v 1.8 2008/06/13 16:25:31 aantoniadis Exp $ ;;;; ;;;;------------------------------------------------------------------ @@ -584,7 +584,7 @@ (format t "~&Solicited-node address: ~/ip6:pprint-ip6/~%" solicited-node-address) (setf (look-up-neighbor neighbor-cache link-local-address :start 0) (mac-address ne2000)) - ;; (format t "~&Local neighbor lookup: ~S.~%" (look-up-neighbor neighbor-cache link-local-address)) +; (format t "~&Local neighbor lookup: ~S.~%" (look-up-neighbor neighbor-cache link-local-address)) ;;comment this out (let ((packet-pool (make-array 16 :fill-pointer 0))) (flet ((get-packet (packet-pool) (cond @@ -704,7 +704,7 @@ (when (= (udp-header-checksum request) (udp-checksum request)) (when (= 1 (udp-header-destination request)) - (setf (muerte:vector-element-type request) + (setf (muerte::vector-element-type request) #.(bt:enum-value 'movitz::movitz-vector-element-type :character)) (let (seqno last-seqno (poff (+ 8 offset))) (multiple-value-setq (seqno poff) @@ -727,7 +727,7 @@ (t (warn "Eval-UDP lost packet ~D." eval-prev-seqno) (setf (fill-pointer eval-buffer) 0 eval-prev-seqno 0))) - (setf (muerte:vector-element-type request) + (setf (muerte::vector-element-type request) #.(bt:enum-value 'movitz::movitz-vector-element-type :u8)))) #+ignore (warn "UDP src ~D, dst ~D, len ~D" From aantoniadis at common-lisp.net Sat Jun 28 23:18:43 2008 From: aantoniadis at common-lisp.net (aantoniadis) Date: Sat, 28 Jun 2008 19:18:43 -0400 (EDT) Subject: [movitz-cvs] CVS tftp-new.lisp Message-ID: <20080628231843.7533725112@common-lisp.net> Update of /project/movitz/cvsroot/tftp-new.lisp In directory clnet:/tmp/cvs-serv27249 Log Message: Added tftp-new.lisp: my attempt to rewrite tftp.lisp Status: Vendor Tag: revision1 Release Tags: start N tftp-new.lisp/ext2fs.lisp N tftp-new.lisp/fs.lisp N tftp-new.lisp/harddisk.lisp N tftp-new.lisp/packet.lisp N tftp-new.lisp/partitions.lisp N tftp-new.lisp/tftp-new.lisp N tftp-new.lisp/vmware-vga.lisp No conflicts created by this import