Hi Waldo,

On 25.06.2015 16:15, Waldo Paz Rodriguez wrote:
> Hi Norman, thanks for the replies, I apply both patches. The first if
> solved the problem that existed with interruptions, but the second still
> does not calculate the capacity correctly, I'm testing with a standard
> SD card of 1GB of capacity. I send the serial output using both got patches:

thanks for the feedback. Could you please give the attached patch a try?

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
diff --git a/repos/os/src/drivers/sd_card/sd_card.h b/repos/os/src/drivers/sd_card/sd_card.h
index d18e62a..62eab05 100644
--- a/repos/os/src/drivers/sd_card/sd_card.h
+++ b/repos/os/src/drivers/sd_card/sd_card.h
@@ -429,9 +429,9 @@ namespace Sd_card {
 					size_t const c_size_mult = Csd1::V1_c_size_mult::get(csd.csd1);
 					size_t const mult        = 1 << (c_size_mult + 2);
 					size_t const block_len   = 1 << read_bl_len;
-					size_t const capacity    = (c_size + 1)*mult*block_len;
+					size_t const capacity    = (c_size + 1)*mult;
 
-					return capacity;
+					return capacity * (block_len/512);
 				}
 
 				if (Csd3::Version::get(csd.csd3) == Csd3::Version::HIGH_CAPACITY)
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

Reply via email to