From 9e55191aa60cb4fb10a562d1bb42056ce422e8e4 Mon Sep 17 00:00:00 2001 From: jonnosan Date: Mon, 5 Oct 2009 04:07:02 +0000 Subject: [PATCH] git-svn-id: http://svn.code.sf.net/p/netboot65/code@202 93682198-c243-4bdb-bd91-e943c89aac3b --- client/inc/disk_transfer.i | 21 ++++++++++++++++----- server/lib/tftp_server.rb | 3 ++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/inc/disk_transfer.i b/client/inc/disk_transfer.i index a3c04d1..6d8016e 100644 --- a/client/inc/disk_transfer.i +++ b/client/inc/disk_transfer.i @@ -11,7 +11,7 @@ errors: .res 1 sectors_in_track: .res 1 sector_buffer_address: .res 2 - + output_buffer_address: .res 2 ;the io_* and tftp_* routines both use the 'output_buffer' so we lose the data in the second sector ;therefore we need to copy the data to here before we use it sector_buffer: .res 512 @@ -67,23 +67,34 @@ upload_d64: kippercall #KPR_TFTP_CALLBACK_UPLOAD jmp after_tftp_transfer +copy_sector_buffer_to_output_buffer: + ldax #sector_buffer + stax copy_src + ldax output_buffer_address + stax copy_dest + ldax #$200 + jmp copymem + read_next_block: ;tftp upload callback routine ;AX will point to address to fill - stax sector_buffer_address + stax output_buffer_address + ldax #sector_buffer + stax sector_buffer_address + lda track cmp #36 beq @past_last_track jsr read_sector - jsr move_to_next_sector bcc @not_last_sector + jsr copy_sector_buffer_to_output_buffer ldax #$100 rts -@not_last_sector: +@not_last_sector: inc sector_buffer_address+1 ldax sector_buffer_address jsr read_sector - jsr move_to_next_sector + jsr copy_sector_buffer_to_output_buffer ldax #$200 rts @past_last_track: diff --git a/server/lib/tftp_server.rb b/server/lib/tftp_server.rb index 8f8576f..d47e5c9 100644 --- a/server/lib/tftp_server.rb +++ b/server/lib/tftp_server.rb @@ -34,6 +34,7 @@ class Netboot65TFTPServer attr_reader :bootfile_dir,:port,:server_thread def initialize(bootfile_dir,port=69) + @bootfile_dir=bootfile_dir @file_list=FileList.new(bootfile_dir) @port=port @server_thread=nil @@ -189,7 +190,7 @@ class Netboot65TFTPServer file_handle=File.open(full_filename,"wb") Thread.new {recv_data(client_ip,client_port,full_filename,file_handle)} rescue Exception=>e - send_error(client_ip,client_port,2,"error writing to '#{filename}':#{e.to_s}") + send_error(client_ip,client_port,2,"error writing to '#{full_filename}': #{e.to_s}") end end when 0x65 : #DIR REQUEST