Re: std::cin in Fiasco/L4Re (with 'make qemu')

Adam Lackorzynski <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
On Sat Sep 20, 2014 at 22:21:14 +0000, Stark, Josef wrote:
> >I'm not sure where you enter this.
> >For me, the following works quite fine:
> >
> >#include <stdio.h>
> >
> >int main(void)
> >{
> >  printf("Press some key: ");
> >  char c = getchar();
> >  printf("\nYour input: %c (%d)\n", c, c);
> >
> >  printf("Enter a number: ");
> >  int number;
> >  scanf("%x", &number);
> >  printf("Your number: %d\n", number);
> >
> >  return 0;
> >} 
> 
> 
> If I copy this code into the hello example, and change the Makefile accordingly:
> 
> PKGDIR		?= ../..
> L4DIR		?= $(PKGDIR)/../..
> TARGET		= hello
> SRC_C		= main.c
> REQUIRES_LIBS   = libc_be_file_stdin
> include $(L4DIR)/mk/prog.mk
> 
> 
> I can successfully run it IF moe runs hello directly
> (without Ned and a config, as a "make qemu E=hello" does).
> 
> If, however, hello is run through a config file and therefore Ned,
> as in hello-cfg, it doesn't work. Execution does not halt and outputs
> invalid values:
> 
> MOE: Starting: rom/ned rom/hello.cfg
> MOE: loading 'rom/ned'
> Ned says: Hi World!
> Ned: loading file: 'rom/hello.cfg'
> hello   | Press some key: 
> hello   | Your input: � (-1)
> hello   | Enter a number: Your number: -2147450972
> 
> 
> How to make it work? Pass a certain capability to hello?

Yes, add 'log = L4.Env.log' (not in 'caps' but besides it).



Adam
-- 
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.