TELKOM NIKA Indonesia n  Journal of  Electrical En gineering   Vol.12, No.6, Jun e  201 4, pp. 4387 ~ 4 3 9 2   DOI: 10.115 9 1 /telkomni ka. v 12i6.547 2          4387     Re cei v ed  De cem ber 2 1 , 2013; Re vi sed  Februar y 9, 2 014; Accepte d  February 2 2 , 2014   A Network Disk Device Based  on Web Accessing       QunFan g  Yuan 1 , Wenxia  DI 2 , YaoLi Wang* 3    1,3 Colleg e  of Informatio n  Engi n eeri ng, T a i y ua n Univ ersit y   of T e chnolog T a iyua n, 030 0 24, Chi na, Ph./F ax: + 008 6-35 160 14 052/3 5 1 601 40 52   2 T a i y u an N o rm al Univ ersit y   T a iyua n, 030 0 12, Chi na, Ph. /F ax: + 0086- 35 148 85 311/3 5 1 488 53 11   *Corres p o ndi n g  author, e-ma i l w i lli ng w a n @ gmail.c o     A b st r a ct    T he future per sona l an d ho me de ma nd of b i g data  h e l ped  fuel an ex plos ion of dev el op me nt i n   netw o rk disk d e vice  mark et. Co mp ared to a  tradition al US B hard driv e, it separate d   the  user from th e h a rd  disk, en joy ed t he a d va ntag of accessi ng  from anyw h ere f o r uns pec ific u s er an d e a sy  o perati on  an d e a sy   expa nsio n. T he pap er esta bl ishe d the re mote access  to  hard dr ives v i a brow ser w i th Xili nx' s  XUP V 5   LX11 0T  F P GA dev elo p m e n boar d. T h e  sys tem mou n ted  a n  AT host c o ntroll er IP c o re  an d c onn ecte d it   to the netw o rk w i th RJ45. By portin g  PetaL i n u x op er atin g s ystem to the M i croBla z e  e m b edd ed pr ocess o r   of FPGA, an inde pe nde nt FAT32 f ile system  mo dul e w a s adde d, the us ers coul d establis h the re mot e   access to h a r d  driv es w i th specific CGI  progr a m s thr oug h the W E B brow ser. It w a s tested that  Person al/Ho m e Netw ork Disk  can meet the  standar ds of b a sic file o perati on.     Ke y w ords :  net work disk, FPGA, FAT file system , CGI        Copy right  ©  2014 In stitu t e o f  Ad van ced  En g i n eerin g and  Scien ce. All  rig h t s reser ve d .       1. Introduc tion    In the age of big data [1], an embed de d net wo rk  storag e device  base d  on F P GA has  been  de sig n e d  an develo ped i n  thi s   p aper to  meet  the p r e ssi ng  deman of a c cessin rem o te  file re so urce s thro ugh  WE B. USB ha rd  drive  can   o n ly provide fil e  resource  in formation  to i t holde r, it d o e not  sati sfy the rand o m  a c cess in g  dem and  of  non -spe cific users.  With  the   contin uou s i m provem ent  of high pe rfo r man c net work te ch nolo g y and the  grad ual ri sin g  of  netwo rk  stora ge mod e  [2], it is a stora g e  mode t hat  uploa ds file s to serve r  ho st which  can  be   acce ssed by use r s th roug h a client an ywhere  throu gh the intern et. A person a l/home net work  disk ba se d o n  FPGA i s  d e s ign ed in  this pape r, a nd  t he system overall arch ite c ture  i s  sh own in  Figure 1 (the  sha ded p a rt is the main work  com p lete d in this pap e r).         Figure 1. System Archite c t u re     Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4387 – 4 392   4388 The  system  i s  divid ed into  hardware lay e r, ker nel lay e r a nd  user l a yer; u s e r  lay e r i s  the   intera ctive op eration i n terfa c e of the sy stem,  hard w a r e  layer achiev es the vari ou s ope ratio n on  unde rlying h a rd di sk of the syste m , kernel l a yer  is respon sible  for the tran smissi on of d r iver  para m eters  a nd d a ta bet ween  user  l a yer a nd  hardware l a yer. IP  core of ATA   host  co ntrolle r is  desi gne d an d mounte d  b y  using X U PV5 LX110T   FPGA devel opment b oard; B/S mode is  adopte d  by  cl ient. As  client  is a  sta nda rd  bro w se r, use r ca compl e te the  remot e  op eratio n o n   the hard  disk by calling rel e vant CGI (Common  Gateway Interface) thr ough  WE B browser on a  PC con n e c te d to the internet. Perso nal /Home  Network  Disk kee p s working al l day long, easy  and  conve n ie nt, and the u s er  stora ge  ca pacity  can b e  expand ed through m ountin g multiple h a rd  disks. T he  sy stem  can  be f u rthe r devel o ped a nd  perf e cted  in the  future  acco rdi ng to the  ge n e ral  method p r op ose d  in the p aper.       2. Sy stem  Desi gn  2.1. Introduc tion  of  Platfo rm  The h a rd wa re platform  st ructure of th system  i s   sh own i n  Fig u re  2, the  syste m  ado pts   Xilinx XUPV5  LX110 T FP GA develo p m ent bo ard,   e m bedd ed wit h   mod u le s su ch as  Mi croBl a ze  soft core, Ethernet controll er, FLASH, DDR an so o n , achieving i n ter-com m uni cation bet we en  module s  th ro ugh PLB  bu s. The lo w-leve l data  stora g e  device u s e s  the ATA  ha rd di sk with  IDE  interface. By con n e c ting th e extended i n terface  of  V5 developm ent  board to FPG A  chip s, client  achi eves the  remote a c ce ss to the hard disk throu gh  acce ssi ng net work.             Figure 2. Hardwa re Platform Structure         In the modules ab ove, the shad ed mod u le  need s to be develop ed  by  users, wh ile other  parts a r e p r o v ided by XUPV5 LX110T F P GA develop ment boa rd     2.2. ATA  Hos t   C ontroller   This p ape r ta ke s Seag ate ST3400 14A  hard  disk (40 G B) with IDE  interface as  a data  stora ge d e vice, compl e tes  the desi gn of  ATA host co n t roller b a sed  on ATA/ATAPI-6 proto c ol  [3 and  packa ge d it into a n  I P  co re fo r int egratin into  different  b u s architectu re  of  ASIC  or  SoC   system s ea sil y  [4]. The stru cture of the  A T A host co ntroller is  sho w n  in Figure 3.   ATA host co ntrolle r incl ud es  Re set, PIO Co ntrol Mo dule, MDMA  Control Mod u l e, Ultra  DMA Control  Module,  re ceive and  sen d  buffer,  whi c h a r e a c hi e v ed with VHDL a nd  simul a ted  and teste d  to be co rrect. T he re set mod u le re sets oth e r mod u le s u nder initiali zat i on or ab no rmal  con d ition s ; PIO Modul e co ntrols th e rea d  and write h a rd di sk ope rations of PIO  mode; MDM A   Module  reali z es th rea d  a nd  write  op erations  on  mul t iword   DMA  mode  of the   hard  di sk; Ult r DMA  Cont rol  Module  is for  the control of  the whole   pro c e s s of a c hi e v ing ha rd  disk a c ce ss in th way of Ultra  DMA; re ceive  and se nd buf fer modul e is  use d  to control data buffer  [5].  Beside s de si gning stri ct seque ntial  logi a nd  state  machi ne, the  key to im ple m enting  ATA host  co n t roller also in clud es re alizi ng the  re ad/ write ope ratio n   on  th e regi ster assig ned   by  proto c ol. The  transmi ssion  of comman d  and co mm and pa ramet e rs a nd the transmissio n of  device  state  i n formatio n a r e complete throug the  read/write o p e r ation  on  re gi ster. T he  dat a   transmissio n of regi sters i n  ATA proto c ol a c co rds  with PIO tra n smi ssi on m ode, the re gi ster  address is g a ted by  setti ng  CS1-,  CS 0-  and  DA   [2 :0],  DIOR-/DI OW- sign al control s  rea d  and   Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     A Netwo r Di sk  De vice Based o n  We b Acce ssing  (Q unFan g Yuan 4389 write; Me an while, ATA ho st controller  an d hard di sk p u ts the d a ta to be tran smitted on  data b u and data o n  the bu s are re ad by cont roll er or  hard  disk acco rdi ng to data tran smissi on di re ction.   The definition s  of regi sters  [6] in ATA/ AT API-6 proto c o l  are listed in  Table 1.           Figure 3. ATA Host Controller Stru cture      First, the  AT A ho st contro ller m odul e h a bee n p a ckaged  into  use r -cu s tomized   IP core  and conn ecte d to the MicroBlaze  pro c e s sor  with  PLB bus; then conne cting the  kernel drive r  to   hard di sk by packa ging X G pio fun c tion s [7], t he hard  disk d r iver i s  defined in Ta ble 2.      Table 1. Re gi ster Add r e ss  and Name   Address Register  Name   CS1-   CS0-  DA Read  Operation   Write  Ope r ation   1 0  Data  Register   1 0  Error  Register   Feature   Register   Sector Count R e gister  LBA Lo w  Registe r  [7:0]   LBA Mid Register [15:8]   LBA High Register [23:16]   Device Register / LBA [27:24]   Status Register  Command Re gister   0 1  Alternate Status  Register  Device Control R egister  1 1  Data  Port       Table 2. Defi nition of Hard  Disk Drive r   ID Function  Name   Description  1 xgpio_ata_init   Initializat ion  2 xgpio_ata_ioctl Control  Device  3 xgpio_ata_ open   Open  D e vice  xgpio_ata_f ops  Device File Oper ation  5 xgpio_ata_ dev  Register  Device  6 xgpio_ata_ exit   Cancel  Register   7 xgpio_ata_ read   Read  Data   8 xgpio_ata_ write   Write  Data       2.3.  FAT File Sy s t em   File sy stem i s  a  brid ge b e twee n the  o per atin syst em an d the  unde rlying h a rd wa re,  whi c ha s b een  wid e ly u s ed  in  emb e dded  sy st em s a n d  othe r f i elds.  U di sk,  MP3, MP4   and  other  digital  device  almo st all ado pt th e Micro s oft  FAT 32 file   system [8], b u t the Mi crosoft  Corpo r ation h a ven’t rele ased the  sou r ce co de of  the  FAT 32 file system, so thi s  pa per  used  a n   open -sou rce proje c t FatF S [9], which is inde pen de nt from the underlyin g DI SK I/O layer, not  depe nd  on t he h a rdwa re  archite c ture  and  ha s g o o d  comp atibility with th Windo ws FAT  file  sy st em.   FAT file syste m  can  be divi ded into thre e levels [10]:  deman d, logi cal an d phy si cal. The   deman d laye sup port s  fo r user’ s   ba sic file op eratio n; the lo gical  layer imple m ents a m a p p ing    Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4387 – 4 392   4390 betwe en FAT  file system  and the  physical laye r;  th e physi cal l a yer imple m e n ts inte rfaces to  physi cal stora ge  me dia,  in cluding   re ad o r  write se cto r s, ha rd  re set  operation. T h e phy sical lay e r   has a c hieve d  five inte rfa c e s : di sk_init i alize  (ini tiali z e th e di sk  drive),  disk_ s tatus (get d i sk  statue), di sk_ r ead (read  se ctor), disk _ w rite(write se ct or), di sk_io c tl(co n trol e quip m ent asso cia t ed   cha r a c teri stics). Usin g these five interfaces, t he dem a nd and lo gic  of the FAT file system  can  be  reali z ed.   The five i n te rface  fun c tio n of the  ph ysical  layer  call PetaLin u x ke rn el d r ive r  [11] to  achi eve the  conne cting  bet wee n  the u n derlying  ha rd  disk a nd file  system, a nd t hen  reali z e t h e   variou s p r oce s ses  of the F a t file system . For ex ampl e, the ope rati onal p r o c e s ses of di sk_re ad,  xgpio_ata _ io ctl and  xgpio _ata_read  de fined in th previou s   se ct ion a c hieve  read  an d wri t e   function of  ATA IP core  regi ster, first pa ss  the  para m eter  a nd data to t he ke rn el; then   xgpio_ata _ io ctl an d xgpi o_ata_ rea d   are  en cap s u l ated in th e  disk_ r ea function  of  the   appli c ation  la yer, it will  me et the  dema n d  of th e file  system lo gical  layer so a s  to impl ement t he  interfaces of the dem and l a yer. All the  Fat file  syste m  ope ration al  pro c e s ses are pa ckage d i n to  a library, so the users will  call the  process di rectly. Al l file system  interface functions are defined  in the appli c a t ion layer for  CGI to call.   The FatFS file system phy sical layer interface  functio n s wo rk pro p e rly after testing, also   meet the dem and s of the logical laye r an d deman d layer.     2.4. User  In terfac The op eratin g system Pet aLinux is a n  i ndu stry stan dard  develop ment enviro n m ent for  embedded Li nux on Xilinx  FPGAs [12], users  can easily est abli s system  devel op environment  with its tool s.  PetaLinux al so integrates  part of  some commonly used  IP  co res, it  will reduce the   worklo ad of porting an d progra mming t he driver p r o g ram s ; the source code al so incl ude much  scripting  whi c h could  simpli fy operation s . Co mpilin g the gene rated  FatFS lib and putting it under  the di re ctory  of PetaLinux  /bin, u s e r s ca n call it   as an  appli c atio n p r og ram.Th e p r ocess is sho w n   in Figure 4.          Figure 4. CGI  Working P r o c e s     The u s e r  inte rface  and th e  system inte rf ace  are  writt en in C l ang uage, they al so me et  the spe c ification of CGI [ 13]. Server  use s  a  singl e-task, hig h  perfo rman ce,  embed ded  web   serve r  Boa [1 4] which fully sup port CGI. Whe n   portin g  the PetaLinu x, it needs to enabl e Boa to   be su ppo rted.   Whe n  the u s er  enters the IP addre ss, t he u s e r ’s browse r will esta blish  a TCP  con n e c tion to  the Boa serv er; CGI re que st will be issu ed to Boa se rver in PetaLin u x when u s e r ’s   action s have  been m ade o n  WEB pag e, Boa se rver  will create a  CGI process  whe n  it recei v es  the re que st, the  spe c ific  e n vironm ent v a riabl es,  para m eters a nd  st anda rdi z ed  in put prog ram  will  be passed to the CGI program.  The results  will be  pas sed to the Boa serv er while the  CGI  prog ram  co mpletes processing. T he  serve r  di sp lays  the data  with identification information   adde d in HT ML We b pag es an d form s to users [15 - 1 7 ].      Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM NIKA   ISSN:  2302-4 046     A Netwo r Di sk  De vice Based o n  We b Acce ssing  (Q unFan g Yuan 4391 For exampl e, the user wh o clicks o n  the "Read"  butt on will trigge r in the form of HTML   page s a nd i s sue s   an  HTT P  req uest to   the serve r  (CGI req u e s t),  sen d s to the  address  of th e   ACTION attri bute in <F ORM> tag.       3.  Demons tra t i on of Sy stem  The pe rsonal/ home net wo rk disk ha s the  following  cha r acte ri stics:  It offers su pe rior  se cu rity and priva c y, the st orage d e vice is vi sible t o  use r , en su ri ng the  data’s p r ivacy  and se cu rity.  It also allows for the function of plug a nd  play, easy to setup, the system  can wo rk  immediately  whe n  co nne cted to powe r  sup p ly and n e twork  cable.   The p e rson a l /home n e twork di sk  ca n  be a c ce sse d  via browser; the P C   whi c h i s   con n e c ted to the netwo rk  can ac ce ss the person a l/ho me netwo rk d i sk  with the u s er’ s  b r o w ser.  Easy to o perate and  exte nd, by ad din g  t he n u mbe r  of h a rd  disk an cha ngi ng the   stora g e  devi c e, the  p e rsonal/hom n e twork di sk  sup port s  use r-d efined   extensi on of sto r age   cap a cit y .   The perso nal /home network disk ke ep s workin g all day long, which can be a c cessed o r   use d  thro ugh  Network  Disk Ma nage me nt System.  The sy stem ru n sm oothly, safe and  stabl e, it  coul d easily  go beyond lo cal area net work an d co nne ct to wide area n e twork. Enter th e IP  address of t he devel opm ent boa rd in  bro w ser:  1 9 2 .168.0.10, t hen the  co n nectio n  will  be   establi s h ed b e twee n PC a nd FPGA developme n boa rd. The u s er  operation inte rface i s  sh own  as follo ws in  Figure 5.        Figure 5. Use r  Ope r ation In terface       Whe n  cli ck  “Uplo ad”  butto n, the system  indica te  users to ch oo se t he file to be u p load ed,  then cli c k “S ubmit” b u tton  and exe c ute  the uploa d o peratio n: the  data will b e   written from l o cal   PC to remote hard dis k .         Figure 6. Upl oad File   Evaluation Warning : The document was created with Spire.PDF for Python.
                               ISSN: 23 02-4 046                     TELKOM NI KA  Vol. 12, No. 6, June 20 14:  4387 – 4 392   4392 4. Conclu sion   The pa per  d e sig ned a nd  impleme n ted  a perso nal/ home n e two r k di sk, mo un ted AT host  controll er IP co re to  the XUPV5  LX110T  FP GA develop ment boa rd,  ported Peta L i nu operating  sy stem, a dde d  inde pen dent  FAT32  file  syste m  mo dule, d e si gn ed the  inte rface  betwe en u s er and ha rd di sk, and the fe asibility of  the pro g ra m is  establi s h ed throu gh p r a c tical   system verifi cation. The pe rso nal/ho m netwo rk  di sk  can b e  furthe r develop ed  and pe rfecte d in   the future a c cordin g with a c tual dem and       Ackn o w l e dg ements   It is a project su ppo rte d  by Shanxi Nati onal Natural Scie n c e Fou ndati ons (No.  2013 0110 15 -1).       Referen ces   [1]  Shi Sh uic a i.  Und e rstand in g  of bi g d a ta , practice  of big  dat a.  h ttp://w enku.bai du.co m/view /   1a3 82 805 07 40 be1 e6 50e 9a 45 .html . 20 12.   [2]  Den g  Yu hui. M a ss Storag e S y stem B a sed  o n  Net w o r k Attached  Disk Arra y. Ph D thesis   of Huaz ho n g   Univers i t y   of Scienc e & T e ch nol og y. 20 04.   [3]  T 13 Working  Draft. Information T e chnology-AT  A ttachment  w i th Pa cket  Interface-6. T 13 T e chnical  Co mmittee . 20 02.   [4]  Qu Z uofu.   T h e Rese arch for AT A Device IP Ba sed on F P GA. Master  T hesis of Lia o  Ning T e chnic a l   Univers i t y . 2 0 0 8 [5]  Z hao Z h enti ng.  T he Desi gn  a nd F P GA Impl em entati on of Net w ork Har d -disk  Stor age   S y stem . Master   T hesis of T a iyu an Un iversity o f  T e chnolo g y.  201 2.  [6]  Li  Xi ao jua n . Ult ra DMA W r ite  Contro ller  Bas ed  on F P GA.  S c ienc e T e ch nol ogy  and  En gin eeri n g . 20 07;  (15).  [7]  Z hang  Gan g Z hang  Bo,  Ch ang  Qin g . De sign  of S o C s y stem. B e ij ing:  Nati ona l D e fe nse In dust r Press. 2012.   [8]  Microsoft Cor. Microsoft EF I FAT 32 F ile S y stem Specific atio n.  Microsoft Co porati o n . 20 00.   [9]  ChaN. F a tF s Gener ic F A T  F ile S y stem Mod u l e http://elm -chan.org/fsw/ff/0 0index_e. html . 2011.   [10]  W ang Y aol i. R e searc h  o n  C l o ud-b a sed  Stor age I n fo rmatio n  S y stem. PhD  thesis  of T a i y u an U n iv ersi t y   of T e chnol og y.   2012.   [11] Petalo gi x.  Ker nel  & Driver C u stomisati on.  h ttp://ww w.petal ogix.co m/serv i c es/platfor m -s ervices/ker nel- driver- custo m i s ation/?s earc h term= d r i ver . 20 09.   [12]  Xu e Huim in, W u   Ch uan hu a ,   Lu Ho ubi ng,   etc.  T r anspla n t of P e taLi nu x ( e mb edd ed   OS) base d   on   MicroBlaz e Microcom puter Inform ation . 2011; (8).  [13]  Li L e i. A ppl icat ion  of CGI Pro c edur e to  Rea l ize D e vel opm e n t W eb Meth o d Scie nce T e c hno logy  a n d   Engi neer in g . 2009; (06): 1 611 -161 3.  [14]  Luo Yi, Z h a ng  Jian w u . T he Applic atio n an Real izati on of  Embed de Lin u x W e bServer  BOA.  Journa l   of Hang z h o u  Institute of Electronic En gin eer i n g . 200 4; (01): 52-5 5 [15]  Liu H u i, Liu Yi min. Rese arch   and D e sig n  of Embed de d W eb Server.  Dig ital Co mmu n ic ation . 20 11; (4).   [16]  W e i Ma, Xiao yong  Li, Yon g   Shi, Yu Guo.  Virtual Mac h in e Cl oni ng  Appro a ch Bas ed o n  T r uste d   Comp uting.  T E LKOMNIKA Indon esia J ourn a l of Electrica l  Engi neer in g . 2013; 11( 11): 69 35-6 942.   [17]  Li Y ue- xi n, Ho ng Z o ng- xi an g.  Res earch  of  Semantic  Net w ork Kn o w l e d g e  Re prese n tatio n  a nd Qu e r Algorit hm Bas ed o n  Re latio nal Mo de l.  T E LKOMNIKA Indon esia J our n a of Electric al  Engi neer ing 201 3; 11(1 1 ): 6591- 659 9.     Evaluation Warning : The document was created with Spire.PDF for Python.